Results 1 to 5 of 5

Thread: DSNLess connection

  1. #1

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38

    Unhappy

    Hi.. again.. im workin in my first ASP page, and.... well this is my code:

    Code:
    <p><%set connDB=Server.CreateObject("ADODB.Connection")
        cnnDB.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\db\betto.mdb")
        Set CmdAddRecord = Server.CreateObject ("ADODB.Recordset")
        strQuery = "select * from datos"%></p>
    
    <p><%set rsInfo=cnnDB.Execute(strQuery)%></p>
    
    <p><%Do while Not rsInfo.EOF
    	Response.Write(rsInfo("Nombre"))
    	rsInfo.MoveNext
        Loop%></p>
    I know i'ts easy but.. doesnt work..it's show me:

    Microsoft VBScript runtime error '800a01a8'
    Object required: ''
    /Computers/betto/DSNLess.asp, line 40

    where line 40 is:

    <p><%set connDB=Server.CreateObject("ADODB.Connection")
    cnnDB.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\db\betto.mdb")
    Set CmdAddRecord = Server.CreateObject ("ADODB.Recordset")
    strQuery = "select * from datos"%></p>

    why?????????.. I mean.. Where????????!!!!!!
    where i need "

    pleeeeeeeeeease
    betto

  2. #2
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118

    Lightbulb

    It is not able to create the object..

    Server.CreateObject("ADODB.Connection")


    make sure whether ADODB dll is registered in your server.....


    Sonia

  3. #3
    Guest

    Check your variable naming

    The object being set for the adodb.connection is named connDB, but the object you are using to open the connection is named cnnDB

    you are missing the "o" in the second object

  4. #4
    Guest
    You will also run into problems with your recordset:

    Set CmdAddRecord = Server.CreateObject ("ADODB.Recordset")


    <p><%set rsInfo=cnnDB.Execute(strQuery)%></p>

    You are creating a recordset object name CmdAddRecord, but trying to populate a different variable with the recordset information (rsInfo).

  5. #5

    Thread Starter
    Member betto's Avatar
    Join Date
    Mar 2000
    Location
    Perú
    Posts
    38
    yeah bubba.... what a jerk I am....
    ..that was.. an "O" .. just a damn "O"!!!!!!!!!...

    ..now this work ... cool..
    yeah.. ASP page are so cool!!!!!!!!

    thanks friends

    betto

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width