Computer Hope

Software => Computer programming => Topic started by: jamesknight.betel on May 29, 2013, 08:31:52 AM

Title: VBA Error index 33 string, Argument exception was unhandles
Post by: jamesknight.betel on May 29, 2013, 08:31:52 AM
Public Class Form1
    Dim con As New OleDb.OleDbConnection
    Dim da As OleDb.OleDbDataAdapter
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dbprovider As String = "Provider=Microsoft.Jet.OLEDB.4.0;
        Dim dbsource As String = "DATA SOURCE:=C:\Users\Finance\Desktop\Test\data.mdb"
        con.ConnectionString = dbprovider & dbsource
        con.Open()
        MsgBox("database opened")
    End Sub
End Class

i get this error :

Argument excpetion was unhandled
Format of the initialization string does not conform to specification starting at index 33.
Title: Re: VBA Error index 33 string, Argument exception was unhandles
Post by: BC_Programmer on May 29, 2013, 12:50:43 PM
I think it needs to end with a semicolon.