Results 1 to 6 of 6

Thread: can't run?

  1. #1
    Join Date
    May 2009
    Posts
    17

    Unanswered: can't run?

    i get this error when i click the continue button

    Run-time error’-2147467259 (80004005)’:

    Unrecognized database format ‘C:\Documents and Settings\welight_meng\Desktop\student4\student\stu dent.mdb’.

    my code:
    Public cnn As New ADODB.Connection
    Public rs As New ADODB.Recordset
    Public rsColor As New ADODB.Recordset

    Public eX As Integer
    Public lst As ListItem

    Public Sub Connect()

    cnn.CursorLocation = adUseClient
    'cnn.Open "msdasql.1;persist security info = false; data source = student"
    cnn.Open "provider=microsoft.jet.oledb.3.51;persist security info = false; data source = " & App.Path & "\student.mdb;"
    'cnn.Open "provider=Microsoft.jet.oledb.3.51;persist security info= false;data source = " & App.Path & "\student.mdb;"


    End Sub


    Public Sub check_rs()
    If rs.State = 1 Then rs.Close
    End Sub
    Public Sub check_rsColor()
    If rsColor.State = 1 Then rsColor.Close
    End Sub

  2. #2
    Join Date
    Feb 2009
    Posts
    29

  3. #3
    Join Date
    May 2009
    Posts
    17
    Quote Originally Posted by jerome.mercado26
    i am totally don't know coz a lot of different compared to my code.

  4. #4
    Join Date
    Feb 2009
    Posts
    29
    Your database which is MSACCESS (i guess) is not a valid MSACCESS....
    it should be the filename not the table name.

    Copy the attache file then extract it

    do this code on your form load:

    This connect you to database
    Code:
    Dim MyConn As ADODB.Connection
    Dim MyRecSet As ADODB.Recordset
    
    Set MyConn = New ADODB.Connection
    MyConn.Open "PROVIDER=MSDATASHAPE;DATA PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=D:\Biblio.mdb"
    in biblio.mdb there are table, now we will use "Authors"

    Code:
    Set MyRecSet = New ADODB.Recordset
    MyRecSet.Open "SELECT * FROM Authors", MyConn, adOpenStatic, adLockBatchOptimistic
    Set DataGrid1.DataSource = MyRecSet
    Attached Files Attached Files

  5. #5
    Join Date
    May 2009
    Location
    Philippines
    Posts
    12
    Quote Originally Posted by ankiesiau
    i get this error when i click the continue button

    Run-time error’-2147467259 (80004005)’:

    Unrecognized database format ‘C:\Documents and Settings\welight_meng\Desktop\student4\student\stu dent.mdb’.

    my code:
    Public cnn As New ADODB.Connection
    Public rs As New ADODB.Recordset
    Public rsColor As New ADODB.Recordset

    Public eX As Integer
    Public lst As ListItem

    Public Sub Connect()

    cnn.CursorLocation = adUseClient
    'cnn.Open "msdasql.1;persist security info = false; data source = student"
    cnn.Open "provider=microsoft.jet.oledb.3.51;persist security info = false; data source = " & App.Path & "\student.mdb;"
    'cnn.Open "provider=Microsoft.jet.oledb.3.51;persist security info= false;data source = " & App.Path & "\student.mdb;"


    End Sub


    Public Sub check_rs()
    If rs.State = 1 Then rs.Close
    End Sub
    Public Sub check_rsColor()
    If rsColor.State = 1 Then rsColor.Close
    End Sub
    the problem is this:
    Code:
    microsoft.jet.oledb.3.51
    try change to:
    Code:
    microsoft.jet.oledb.4.0
    "More Heads Are Better Than One"

  6. #6
    Join Date
    May 2009
    Posts
    17
    Quote Originally Posted by jp26198926
    the problem is this:
    Code:
    microsoft.jet.oledb.3.51
    try change to:
    Code:
    microsoft.jet.oledb.4.0

    thank you.

Posting Permissions

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