By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,905 Members | 900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,905 IT Pros & Developers. It's quick & easy.

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

P: 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
Share this Question
Share on Google+
3 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

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

REgards
Veena
Mar 6 '08 #2

P: 2
Hi,

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

Thanks
Indy
Mar 7 '08 #3

QVeen72
Expert 100+
P: 1,445
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.