ConnctionString for MSAccess MDB and MDW

  • Thread starter Joerg Trumpfheller
  • Start date
J

Joerg Trumpfheller

Hello

I like to build a connection String for
a) Oracle DB
b) Access DB with a workgroup system.mdw and user and password

the construct is like the following:

I was trying
a)
Dim CString As String = "Provider=OraOLEDB.Oracle.1;User
ID=myusr;Password=mypwd;Persist Security Info=True;Data
Source=mytnsnames;Extended Properties=''"

Dim dbConn As New OleDb.OleDbConnection(CString)
Dim dbCom As New OleDb.OleDbCommand("", dbConn)
Dim dbAdapter As New OleDb.OleDbDataAdapter(dbCom)

dsData = New DataSet("MyDataSet")

dbCom.CommandText = SQL(0) 'Select string for a table
Try
dbAdapter.Fill(dsData, "1-Modell")
Catch ex As Exception
MsgBox(ex.ToString)
End Try

for Oracle it works fine.

Now I tried to use our "save" access-db
b)
CString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security
Info=False;User ID=Admin;Data Source='Pathfor\application.mdw' /user
'userid' /pwd '****' 'Pathfor\application.mdb';Extended Properties=''"

Does anyxbody know how I can make it?

Thanks for support
Joerg Trumpfheller
 
J

Joerg Trumpfheller

Hello Herfried,
thanx for the tip, but .NET needs some more parameters

I rebuild it by using the existing data tool oledbadapter, oldbconnection
and dataset
I filled it and it works fine.
Using the same connection string for the example I have shown throws an
exception
"Installable ISAM not found" (something like this - it is a German Message)

What's wrong? Is there any libary missing?

greetings
Jörg Trumpfheller
 
C

Cor

Hi Joerg,
It sounds if you are using DOA in it to create the database, that asks for a
ISAM for the locale parameters, is it something like that?
Cor
 
P

Paul Clement

¤ Hello Herfried,
¤
¤ > Did you have a look at <http://www.connectionstrings.com>?
¤ thanx for the tip, but .NET needs some more parameters
¤
¤ I rebuild it by using the existing data tool oledbadapter, oldbconnection
¤ and dataset
¤ I filled it and it works fine.
¤ Using the same connection string for the example I have shown throws an
¤ exception
¤ "Installable ISAM not found" (something like this - it is a German Message)
¤
¤ What's wrong? Is there any libary missing?

The ISAM message typically indicates that either the connection string is incorrect or you're
missing the Jet database components.

If you can connect with the Data Link Wizard then it's likely a problem with the connection string.
Try removing some of the parameters from the connection string to see if it works:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=E:\My
Documents\db1.mdb;Jet OLEDB:System database=c:\winnt\system32\system.mdw;"


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

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