Sunday, February 19, 2012

Distributing database with app

Sorry if this something beaten to death already...

What is/should be required for a target client machine to use and connect to a local copy of a SqlExpress database? Can't seem to get a db connection established to a different machine through a VB6 app. Installed the sql native client on the machine, but still can't connect. What am I missing, or do I have to distribute/install the entire SqlExpress client? Working fine from my development machine.

Rick

If you are connecting via TCP/IP you have to enable these protocols. You also have to ensure to enable remote connections.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||I'm not using a remote connection. It's a local copy of the database. What simply does the target deployment machine require or in order for the VB app to connect to the db?

|||The deployment machine needs a Data access components like MDAC or SQL Native Client, both the app machine and the database machine must be able to negotiate to a common protocol like TCP/IP. If that is used you have to allow remote connections on the database server and if you are using another port than 1433 either specify that in your connecting string like MachineName\SQLExpress,Portnumber or start SQL Browser on the database server which will automatically redirect the request to the appropiate port.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||Thanks Jens. I don't quite understand what you're saying with remote connections. There is no database machine. This is all starting to sound like every target machine for my application requires SqlExpress be installed on that machine, or a server that machine is connected to. Is this correct or not?

|||

Do you have SQL Express installed anywhere?

You must have a SQL Server running in order to access your data. There are two basic models to do this:

Local Data Access - SQL Express is installed on the same computer with the application. Each user has thier own copy of the database installed on their computer and data is not shared. This is the configuration for a single user application.|||Mike ... I was speaking of Local access (and think I used the term "local" a few times). All I've been asking is -- must SqlExpress be installed a client machine, be it local or server? Apparently, the answer is yes, which complicates distribution and installation by end-users who won't have a clue. I was under the mistaken impression it was not unlike distributing an Access mdb file. I'm clear on this point now. Thanks.

Now I'm trying to understand more on User Instance usage:

If not specified in the connection string, what is the default, yes or no?
For shared multiuser usage located on a server, should it be enabled or not?

I'm just unclear on when/when not to use it.

TIA ... Rick

|||If you don′t uise the user instance keyword you use SQL Server Exprtess just as a normal database. If you want to attach the database to a SQL Server instance you don′t need to use User instance availbility. Just attach the db to a SQL Servert (Express) and connect via the "normal* connection string to it (without specifying something like user instance)

HTH, Jens SUessmeyer.

http://www.sqlserver2005.de

|||

Hi Rick,

Regarding User Instances:

If you don't specify it in the connection string, User Instances are not used.

No comments:

Post a Comment