473,721 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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
  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
  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 
  14. connection string
  15. mDb = strDb
  16. mServer= strServer
  17. mUsr = strUserName
  18. mPwd = strPwd
  19. End Sub
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

Mar 6 '08 #1
3 6240
1,445 Recognized Expert Top Contributor

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

Mar 6 '08 #2
2 New Member

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

Mar 7 '08 #3
1,445 Recognized Expert Top Contributor

To Add References,

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

Mar 7 '08 #4

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

Similar topics

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 / http://starship.python.net/crew/bhoel/
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, although all the Agile literature talks about the importance of doing Acceptance Testing, there's very little in any of the books or out on the Web that helps with how to do it. If I am on the right track, this will be one more helpful item...
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 make test it goes through to create, passes that then stops for 30 seconds and give the error that the '/master.pid file was not created in 30 seconds; Aborting.' and the test dies. It's compiled on RedHat 9 if that makes a difference. I'd like to...
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: /home/tekton/src/mysql-4.0.13/mysql-test/var/run/master.pid was not created in 30 seconds; Aborting Or can this be safely ignored? Any help would be appreciated. Thanks,
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 unexpected run-time problems. Exceptions on the other hand can not be simply ignored. In order to solve this error codes problem I suggest using error object instead of error codes. Each function has to return an error object that stores an error
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 my scanf ("%c",&q); On input 3 4 1 (for a,b and c) I had real roots OK On input 1 8 16 I had same real roots OK. However on 4 2 5, (for imaginary roots ) the computer cannot see the scanf ("%c",&q); statement. It just jumps...
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") WshNetwork.AddWindowsPrinterConnection pname mkDef = msgbox ("Do you want " & pname & " to be your default printer?", 292, "Default Printer Status") If mkDef = 6 Then WshNetwork.SetDefaultPrinter pname
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 Visual Studio. Error 1 The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) C: \Documents and Settings\HP_Administrator\My Documents\Visual Studio
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+ +) { if (document.getElementById('cmbList').options.value ==
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. The script is pretty simple: set oDocObject = CreateObject("DocumentObject") 'msgbox's, setting properties, etc dim oFeeProcessorObject set oFeeProcessorObject = CreateObject("FeeEngine")
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.