Database connection problem

debbieseal

New Member
I have the following code:<BR> connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="path odbfile.mdb;" <BR><BR>How do I do this through the use of DBQ="path"<BR>what is the snippet for that line?<BR><BR>MikeCould you elaborate? You want to use a different type of connection string or you are having a problem with the one you are using?The DATA SOURCE replaces it.In asp 3.0 I would use<BR><%<BR>dim Conn<BR> Conn=Server.CreateObject("ADODB.Connection")<BR> Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\premfs4sitespremium9eliasondatabaseevents.mdb ;"<BR>%><BR><BR>How do I do the same type of connection in ASP.net<BR><BR>mike.NET uses OleDB<BR>Looky here:<BR>http://www.learnasp.com/learn/dbopen.aspI am trying to get this to work<BR><BR>connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="\premfs4sitespremium9eliasondatabaseevents.mdb;"<BR><BR>But I get the error BC30188: Declaration expected.<BR><BR>I havent done this before so trying tolearn how to connect to my access databaseDid you dim ConnString AS String?yup here all teh code<BR><BR>'Create a connection string <BR> Dim connString as String <BR> connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="\premfs4sitespremium9eliasondatabaseevents.mdb;"<BR>'Open a connection <BR> Dim objConnection as OleDbConnection = New OleDbConnection(connString) <BR><BR> objConnection.Open()Of the code that you're using to open the connection.Looks like you have extra quotes in thereWy is the path not part of the string? It should be.<BR><BR>connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=\premfs4sitespremium9"but no one ever listens to me anyway :)Still no Love...<BR><BR>'Create a connection string <BR> Dim connString as String <BR> connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=\premfs4sitespremium9eliasondatabaseevents. mdb"<BR>'Open a connection <BR> Dim objConnection as OleDbConnection = New OleDbConnection(connString) <BR><BR> objConnection.Open()He replied to you, so take it away. ;-)
 
Back
Top