|
-
Jun 27th, 2003, 02:09 PM
#1
Thread Starter
Sleep mode
sql connectionstring for mdb database ?[Resolved]
Can I use this to connect to mdb database ?? if yes , how ?
Code:
myConnection.ConnectionString = "Persist Security Info=False;Integrated
Security=SSPI;database=northwind;server=mySQLServer;Connect Timeout=30";
edit : I mean where do I have to put the path and password if it's protected ?
Thanks
Last edited by Pirate; Jun 27th, 2003 at 02:38 PM.
-
Jun 27th, 2003, 02:15 PM
#2
Frenzied Member
The connectionstring above is to SQL Server not an Access mdb database.
try this
For OLEDB Connection
VB Code:
Dim oOleDbConnection As OleDb.OleDbConnection
Dim sConnString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\myPath\my.mdb;" & _
"User ID=;" & _
"Password="
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
For ODBC Connection
VB Code:
Dim oODBCConnection As Odbc.OdbcConnection
Dim sConnString As String = _
"Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=;" & _
"Pwd="
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()
Last edited by Memnoch1207; Jun 27th, 2003 at 02:18 PM.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 27th, 2003, 02:20 PM
#3
Thread Starter
Sleep mode
I know it's for SQL but I was wondering if I can use SqlConnection object instead of OleDbConnection to open mdb database . Is this possible ???
-
Jun 27th, 2003, 02:29 PM
#4
Frenzied Member
AFAIK, no you can't...The OleDbConnection object can be used to with either SQL Server or Access, but SqlConnection object can only be used for SQL Server.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 27th, 2003, 02:32 PM
#5
Fanatic Member
i'll back that up as well. SQLclient namespace stuff can only be used with SQL sever 7 and 2000
-
Jun 27th, 2003, 02:33 PM
#6
Thread Starter
Sleep mode
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|