472,146 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

C:\test.vbs(2, 10) Microsoft VBScript compilation error: Expected end of statement

2
Hi,
I am new to VB and have some previous programming experiences.
Curently working as an IT support person and trying to write a VB 6 script to access apos database and get one of the table's field value.

I think this is not that hard for a experience VB programmer, but I am kind a stuggling.

Can any one have a similler code for this task?

When I am compling my code I am getting an error in the first line.
Expand|Select|Wrap|Line Numbers
  1. Dim Conn as Connection
  2. ' public variables for the server, database, user name and password
  3.  
  4. Public mServer as String
  5. Public mDb As String
  6. Public mUsr As String
  7. Public mPwd As String
  8. Public mRst As New Recordset
  9.  
  10. 'The class is as under: 
  11. Private Sub Class_Initialize()
  12. ' initializing the class for the Server Name, Database name, user name and password for 
  13.  
  14. connection string
  15. mDb = strDb
  16. mServer= strServer
  17. mUsr = strUserName
  18. mPwd = strPwd
  19. End Sub
  20.  
error: C:\test.vbs(2, 10) Microsoft VBScript compilation error: Expected end of statement

Complier doesn't understand "as" somehow..
Do we have to import any libraries??

Can someone please help..

my emai address:mail id removed

Thanks,
Mar 6 '08 #1
3 6130
QVeen72
1,445 Expert 1GB
Hi,

You Need to add Microsoft ActiveX DataObject 2.0 Library
(Or any Higher version available)

REgards
Veena
Mar 6 '08 #2
Indy
2
Hi,

Thanks for ur support. Can you please let me know how to do so.

Thanks
Indy
Mar 7 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

To Add References,

Goto Menu : Project >> References
Select the above said Library and Apply

Regards
Veena
Mar 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Berthold Höllmann | last post: by
6 posts views Thread by Steve Jorgensen | last post: by
reply views Thread by Jamie Krasnoo | last post: by
reply views Thread by Jamie Krasnoo | last post: by
2 posts views Thread by Gregory | last post: by
38 posts views Thread by Red Dragon | last post: by
9 posts views Thread by hendedav | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.