Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBA code to vbscript

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,38785
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBA code to vbscript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBA code to vbscript - 10/17/2006 1:23:02 AM   
  ze_colmeia

 

Posts: 7
Score: 0
Joined: 10/17/2006
Status: offline
Hello

Im a newbie in vbscript but i can do a few things with VBA. I need to convert this code from VBA to vbscript:


      

Can anyone help me on this? Thanks in advance!
 
 
Post #: 1
 
 RE: VBA code to vbscript - 10/17/2006 1:42:11 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Well, the conversion from VBA to VBScript is usually relatively painless. In your case however, there is a fair amount of code that is missing. For instance I can tell that the code is part of a Function that has optional parameters. Optional parameters are not supported in VBScript so we would need to see the rest of the function to straighten out the logic to avoid the optional parameter. We do not know what the BuildCriteria function does so we can't tell you if the call you it is valid VBScript or not. I assume that rst is a recordset, but I can't know that for sure. I can't tell you if the things you are doing with rst are valid VBScript or not since I don't know how it is created. I have no clue what objTree is without seeing the code to create it. So basically we can't convert it without seeing all of it.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ze_colmeia)
 
 
Post #: 2
 
 RE: VBA code to vbscript - 10/17/2006 2:22:48 AM   
  ze_colmeia

 

Posts: 7
Score: 0
Joined: 10/17/2006
Status: offline
Thanks for your reply.

Im trying to implement a TreeView Control on a page. I have the VBA code for an Access form and know i need to have the same but using vbscript.

Here is all the VBA code:

      

I took this from msdn library.

The BuildCriteria method returns a parsed criteria string to set a ServerFilter property.

< Message edited by ze_colmeia -- 10/17/2006 2:30:10 AM >

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: VBA code to vbscript - 10/17/2006 2:49:59 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Well, one of the web gurus will have to come along to address getting it all into a TreeView. For the general things, remove any "As XXXXXX" statements and change them to Dim commands. Get rid of the optional parameter for the AddBranch function. Get rid of any Labels and any Goto statements.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ze_colmeia)
 
 
Post #: 4
 
 RE: VBA code to vbscript - 10/17/2006 3:03:39 AM   
  ze_colmeia

 

Posts: 7
Score: 0
Joined: 10/17/2006
Status: offline
Yes i already passed that part.

I am struck on the code i first posted. I also searched and found that for the Optional value i would have to create an Array. Is that the only way?

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: VBA code to vbscript - 10/17/2006 3:26:01 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
An array is one way. Usually a better solution is to change your logic so you don't need an optional poarameter at all.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ze_colmeia)
 
 
Post #: 6
 
 RE: VBA code to vbscript - 10/17/2006 3:51:21 AM   
  ze_colmeia

 

Posts: 7
Score: 0
Joined: 10/17/2006
Status: offline
Ok thanks...

if any vbscript guru is out there please don't hesitate

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: VBA code to vbscript - 10/17/2006 10:07:33 PM   
  ze_colmeia

 

Posts: 7
Score: 0
Joined: 10/17/2006
Status: offline
Any one Please?

(in reply to ze_colmeia)
 
 
Post #: 8
 
 RE: VBA code to vbscript - 10/17/2006 10:56:31 PM   
  ze_colmeia

 

Posts: 7
Score: 0
Joined: 10/17/2006
Status: offline

      


I got this code but it keeps sending me this error: "Microsoft Jet Database Engine: Cannot open any more tables."

This happens after the Call of FillTreeNew. What am i doing wrong here?

(in reply to ze_colmeia)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBA code to vbscript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts