shlvy Posted August 20, 2004 Posted August 20, 2004 Hi I use access connection and i want to convert it to SQLConnections, I use SQL SERVER 2000. The access Connection is: dim Conn as new OleDbConnection( _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\inetpub\wwwroot\R.mdb") What will be the SQL Connection? Is there another things that i have to change? My DataBase = R My Table is: tblUsers I dont use UserID or Password. I have been in http://www.stringconnections.com, but it still don't work, there are semantic errors. Thank's. Quote
Administrators PlausiblyDamp Posted August 20, 2004 Administrators Posted August 20, 2004 If you are connecting to SQLServer then use a SQLConnection rather than a OleDbConnection. The connection string for a windows authenticated connection has the form of "Data Source=;Initial Catalog=;Integrated Security=true" if you are using SQL authentication then it would be "Data Source=;Initial Catalog=;uid=;pwd= Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
shlvy Posted August 20, 2004 Author Posted August 20, 2004 Hi Thank's for your answer but i tried the next connection and it's not work, can you write the right string connection? dim Conn as new OleDbConnection("Provider=" & "Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=ServerName;Initial Catalog=DataBaseName;Integrated Security=true") Thank's. Quote
Administrators PlausiblyDamp Posted August 20, 2004 Administrators Posted August 20, 2004 Did you use the SQLconnection object? What errors did it give? If you are using SQL you certainly don't need the provider=Microsoft.Jet bit in there Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
shlvy Posted August 20, 2004 Author Posted August 20, 2004 Hi When i wrote: dim Conn as new OleDbConnection("data Source=servername;Initial Catalog=DataSource;Integrated Security=true") I got the next error: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'. Thank's. Quote
Administrators PlausiblyDamp Posted August 20, 2004 Administrators Posted August 20, 2004 Sorry but which bit of use a SQLConnection rather than a OleDbConnection did you miss? You are still using an OleDbConnection - try using a SqlConnection object instead Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.