Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: VBA Error index 33 string, Argument exception was unhandles  (Read 5266 times)

0 Members and 1 Guest are viewing this topic.

jamesknight.betel

    Topic Starter


    Starter

    • Experience: Beginner
    • OS: Windows 7
    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.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: VBA Error index 33 string, Argument exception was unhandles
    « Reply #1 on: May 29, 2013, 12:50:43 PM »
    I think it needs to end with a semicolon.

    I was trying to dereference Null Pointers before it was cool.