Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Struggling to change an Access Connection string to MS SQL Server Expand / Collapse
Author
Message
Posted Thursday, July 4, 2013 12:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 5, 2014 9:38 PM
Points: 3, Visits: 17
Hi there,
I have an evaluation application that I am trying to configer to use SQL server instead of the built in Access database.

I have created and set up all the tables and fields on the SQL server, but cannot get the database functionality to connect and work correctly.

The string this is used for the Access DB is as follows:

Function OpenDB
Dim Conn
' Connect the database
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
Conn.Open Server.MapPath("dbname.mdb")
Set OpenDB = Conn
End Function


For SQL server, the string is usually very different, like:

Conn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=username;pwd=password;Initial Catalog=MyDatabse;Data Source=ServerName"


How and where can I make changes to this string, so that I can get things to work with SQL Server, rather than with Access?

Many thanks

Hans




Post #1470324
Posted Thursday, July 4, 2013 8:01 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, April 24, 2014 10:51 AM
Points: 8, Visits: 22
This sounds like an application level issue vs. a database issue.
Post #1470547
Posted Friday, July 5, 2013 1:42 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 7:03 AM
Points: 146, Visits: 267
The exact string you use depends upon how you connect to the SQL server back end (the Provider) and how the security/authentication is set up on SQL server. Below is a helpful resource on connection strings with examples (it's geared toward SQL Server 2005, but a lot of it applies to later versions) and other information:

http://www.connectionstrings.com/sql-server-2005


____________
Just my $0.02 from over here in the cheap seats of the peanut gallery - please adjust for inflation and/or your local currency.
Post #1470867
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse