disconnected experiment

B

barret bonden

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()
 
V

Val Mazur \(MVP\)

Looks like there is something wrong with the connection string, but I
personally do not see anything obvious. I would suggest to remove all the
properties first from the connection string except Provider, User ID and
Data Source. It should work. Then try to add properties one-by-one and see
which one causes troubles
 
G

gabe garza

bs is trying to intitialize with double quotes, yet you have double quotes
for Extended Properties, System Database and Registry Path.
Change Extended Properties, System Database and Registry Path to use single
quotes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top