CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2001
    Posts
    14

    Urgent :connecting to database without DAO object.

    Dear,
    I am not using any DAO objects for my application. I have included the DAO references for my project. i am creating a database object.

    dim db as database
    dim rs as recordset
    private sub form_load()
    set db = opendatabase(path,false,false)
    set rs = db.openrecordset("table",options)
    end sub




    This code works fine if my database is not set a password. But if it is set a password it says odbc call failed. I have used workspace too.
    can some one give me a solution along with an example.
    Thank You



  2. #2

    Re: Urgent :connecting to database without DAO object.

    using ADO


    dim cn as new adodb.connection
    dim rs as new adodb.recordset

    cn.userlocation=aduseclient
    cn.open "Provider=Microsoft.Jet.OLEDB.4.0;Password=mypwd;Data Source=mydb.mdb;Persist Security Info=true"

    rs.open "table",cn,,,adtable

    '... ecc...







    [/vbcode]

    <center>
    <HR width=80%>
    <img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
    </center>

  3. #3
    Join Date
    Aug 2001
    Posts
    14

    Re: Urgent :connecting to database without DAO object.

    dear berta,
    i am not using ados too..


  4. #4

    Re: Urgent :connecting to database without DAO object.

    i'm sorry... but the subject of your mail is "connecting to database without DAO object."

    <center>
    <HR width=80%>
    <img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
    </center>

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

Featured