Wow, that's a hefty string and your naming it "bs" is very fitting - looks
like the bloat that VS wizards adds just for the sheer fun of it ;-)
I think the problem is your use of embedded empty-string values using
doublequotes in the quoted string, you have to either double up embedded
doublequotes or just not add those particular arguments in this case since
no value means use the default. But maybe your cut & paste changed the
number of quote characters.
In any case, try pulling back to just what's really needed to connect to Jet
then add in the extra arguments till you hit the bad line. Try the snipppet
below (which shows embedded doublequotes used to keep the path string
together), replacing the path string with one that points to your own Jet
file
Imports System.Data.Oledb
....
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=""C:\Program Files\Microsoft Visual
Studio\VB98\biblio.mdb""")
cn.Open()
MsgBox(cn.State.ToString)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Robert Smith
Kirkland, WA
www.smtihvoice.com [quoted text, click to view] "barret bonden" <arthur@networks-cc.com> wrote in message
news:tq31e.2090$U93.1748@fe12.lga...
>I get
>
> An unhandled exception of type 'System.ArgumentException' occurred in
> system.data.dll
> Additional information: Format of the initialization string does not
> conform to specification starting at index 175.
>
> from this line: cn.ConnectionString = bs
>
> listing (more or less out of page 712, MS's "Programming VB.net")
> Dim bs As String
>
> bs = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
> Source=C:\backup\laptop\debt\benifits.mdb;Mode=ReadWrite|Share Deny
> None;Extended Properties="";Jet OLEDB:System database="";Jet
> OLEDB:Registry
> Path="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet
> OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet
> OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet
> OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
> Repair=False;Jet OLEDB:SFP=False "
>
> Dim cn As New OleDbConnection
>
> cn.ConnectionString = bs
>
> cn.Open()
>
>