Results 1 to 4 of 4

Thread: [RESOLVED] Connection String

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Resolved [RESOLVED] Connection String

    Connection String
    VB Code:
    1. Connects.Provider = "Microsoft.jet.oledb.4.0"
    2.  Connects.Properties("Jet OLEDB:database Password").Value = Trim(Softpassword)
    3.  Connects.ConnectionString = "data source=" & Dr + Software
    I get this On Debug

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Layout\Lay.Mdb;Jet OLEDBatabase Password=13241"

    Then When I do a

    Connects.Open

    I get this "Data Source=C:\Layout\Lay.Mdb"

    And A error Not a Database Format

    Any Ideas
    Last edited by Dbee; Sep 11th, 2006 at 12:07 AM.
    Don
    (OLD DOS Programmer)

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: Connection String

    Maybe the database file has been corrupted, can you open it with access?
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2000
    Posts
    462

    Re: Connection String

    This is a Working access97 database and the Compact routine says un recgonized Format'

    compact routine:
    VB Code:
    1. Sub Do_Compact()
    2.  Dim JRO As New JRO.JetEngine
    3.  Dim cnnSrc As New ADODB.Connection
    4.  Dim strSource As String
    5.  Dim strDestDB As String
    6.  Dim strPassword As String
    7.  Dim iFileStart As Integer
    8.  Dim tl As Long
    9.  strPassword = Trim(Softpassword)
    10.  strSource = Dr + Software
    11.  iFileStart = InStrRev(strSource, "\", , vbTextCompare)
    12.  strDestDB = Mid$(strSource, 1, iFileStart) & "Backup of " & Mid$(strSource, iFileStart + 1)
    13.  JRO.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strSource & ";Jet OLEDB:Database Password=" & strPassword, _
    14.  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDestDB & ";Jet OLEDB:Database Password=" & strPassword
    15.  Kill strSource
    16.  Name strDestDB As strSource
    17.  Set JRO = Nothing
    18. End Sub
    Last edited by Dbee; Sep 11th, 2006 at 05:50 AM.
    Don
    (OLD DOS Programmer)

  4. #4
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Connection String

    Have you tried using the old provider MDAC 3.51?
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


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