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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Indy
    New Member
    • Mar 2008
    • 2

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

    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.
    [code=vb]
    Dim Conn as Connection
    ' public variables for the server, database, user name and password

    Public mServer as String
    Public mDb As String
    Public mUsr As String
    Public mPwd As String
    Public mRst As New Recordset

    'The class is as under:
    Private Sub Class_Initializ e()
    ' initializing the class for the Server Name, Database name, user name and password for

    connection string
    mDb = strDb
    mServer= strServer
    mUsr = strUserName
    mPwd = strPwd
    End Sub
    [/code]

    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,
    Last edited by debasisdas; Mar 6 '08, 10:20 AM. Reason: removed mail id and added code tags
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

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

    REgards
    Veena

    Comment

    • Indy
      New Member
      • Mar 2008
      • 2

      #3
      Hi,

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

      Thanks
      Indy

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi,

        To Add References,

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

        Regards
        Veena

        Comment

        Working...