"dj" <dj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E4EE9BA1-5E9C-4A6E-A580-D01F014CC6D1@xxxxxxxxxxxxxxxx | Can anyone explain why this string works:
| ' gconMyCon.Open "Driver={SQL
|
Server};Server=MyServerName;Database=MyDbName;Trusted_Connection=
yes"
|
| but this one does not:
| gconMyCon.Open "Driver={SQL Server};Server=" & strServerName &
";Database="
| & strDbName & ";Trusted_Connection=yes"
|
| I am simply trying to pass the server and database names ot the
connection
| string, but ADO (2.8) does not like this. Why not?
|
| TIA!
|
| Cheers,
| dj
It could be because of the way you've constructed the string.
I'm going to assume that strServerName has been populated with
the name of your server,
and also that strDBName has also ben populated with the name of
your database. If that is the case, then try this:
RE: SQL Connection Problem ... sites do not have a dedicated database or web server for them to run on. ... > Boolean& failoverDemandDone, String host, String failoverPartner, String ... > user, String password, Boolean trusted, String connectionString) +68 ... (microsoft.public.dotnet.framework.aspnet)
SQL Connection Problem ... An error has occurred while establishing a connection to the server....database location within the applications App_Data directory. ... Boolean& failoverDemandDone, String host, String failoverPartner, String ... user, String password, Boolean trusted, String connectionString) +68 ... (microsoft.public.dotnet.framework.aspnet)
[2.0] Cannot create membership database on webhost provider ... On my shared hosting I created a SQL Server 2005 database,... 40 - Could not open a connection to SQL Server) ... Boolean& failoverDemandDone, String host, String failoverPartner, String ... (microsoft.public.dotnet.framework.aspnet.security)
Web Part and Access database ...Server Error in '/Webparts' Application. ...SQLExpress database file auto-creation error:... The connection string specifies a local Sql Server Express instance ... String user, String password, Boolean trusted, String connectionString)... (microsoft.public.sharepoint.portalserver.development)
Personal Web Site Starter Kit - Cant connect to Personal.mdf ... An error has occurred while establishing a connection to the server....database location within the applications App_Data directory. ... Boolean& failoverDemandDone, String host, String failoverPartner, String ... user, String password, Boolean trusted, String connectionString) +110 ... (microsoft.public.dotnet.general)