473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 6222
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

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

Similar topics

9
by: Berthold Höllmann | last post by:
Hello, The error desribed in SF error report No. 870120 (segmentation fault in test_re) still persists for me in 2.3.4c1. Regards Berthold -- bhoel@web.de /...
6
by: Steve Jorgensen | last post by:
I'm posting this message for 2 reasons. First, I'm still pretty new and shakey to the whole Acceptance Testing thing, and I'm hoping for some feedback on whether I'm on the right track. Second,...
0
by: Jamie Krasnoo | last post by:
Hey all, I was trying to compile, test and install MySQL-4.0.13. Compile went well and it was configured with --with--innodb --enable-assembler --prefix=/usr and nothing else. However when I...
0
by: Jamie Krasnoo | last post by:
Could anyone tell me how to get past this error please? When I 'make test' some of the tests run but then it dies with. create ERROR:...
2
by: Gregory | last post by:
Hi, One of the disadvantages of using error handling with error codes instead of exception handling is that error codes retuned from a function can be forgotten to check thus leading to...
38
by: Red Dragon | last post by:
I am self study C student. I got stuck in the program below on quadratic equation and will be most grateful if someone could help me to unravel the mystery. Why does the computer refuse to execute...
0
by: neo3114 | last post by:
I am trying to use a web page on our local intranet running on IIS server to add printers the following is the vbs Function addPrint(pname) Set WshNetwork = CreateObject("WScript.Network") ...
2
by: dejavue82 | last post by:
Does anybody know how to resolve the following errors? They were caused by the designer.cs file that was auto-generated by the LINQ to SQL designer. I am using the March 2007 Orcas CTP version of...
9
by: hendedav | last post by:
Gang, I am trying to get a regular expression test to work and can't figure out why. I will give you the code below: for (var j=0; j<document.getElementById('cmbList').options.length; j+...
0
by: stopohno | last post by:
I have written 2 C# project's in the same solution: FeeEngine and DocumentObject. I wrote a simple vbscript to test creating the objects since I am compiling the output into dll's using COM Interop....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.