Results 1 to 2 of 2

Thread: Catastrophic failure on "cn.open"

  1. #1

    Thread Starter
    Member lex_ph's Avatar
    Join Date
    Dec 2006
    Location
    Philippines
    Posts
    37

    Catastrophic failure on "cn.open"

    hi guys. i'm trying out the ado tutorial and this code was from the tut. can someone help me out. im using vb6, ms access 2002.
    VB Code:
    1. ...
    2. Set conn = New ADODB.Connection
    3.     conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    4.     "Data Source=" & App.Path & "\db1.mdb"
    5. [color=red]    conn.Open[/color]
    6. Set rcst = New ADODB.Recordset
    7.     rcst.Open "tbl_master", conn, adOpenKeyset, adLockPessimistic, adCmdTable
    8. ...

    i'm having a "CATASTROPHIC FAILURE" and it points to the red text (conn.Open) and i don't know why. someone help me please. i am still new to database devt.
    Last edited by lex_ph; Jan 22nd, 2007 at 10:56 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Catastrophic failure on "cn.open"

    Try this
    VB Code:
    1. Dim strConString As String
    2. Set conn = New ADODB.Connection
    3.  
    4.     strConString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    5.     "Data Source=" & App.Path & "\db1.mdb"
    6.     conn.ConnectionString = strConString
    7.     conn.Open strConString

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