By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

C# - ADODB - Failure to connect on deployment

P: n/a
Hi

I have an application that connects to a SQl database on my computer
via an ADODB connection:

ADODB.Connection Conn = new ADODB.Connection();

Conn.ConnectionString = ("Driver={SQL
Server};Server=4P-12.Leighton.local;Database=HD;Uid=l0073;Pwd=cheese ");

Conn.Open(dbconnection, "", "", -1);

ADODB.Recordset rs = new ADODB.Recordset();
rs.Open("SELECT * from [HD-Users]", Conn,
ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 1);

This works fine when running from the code, or even deploying it and
installing on my machine.

However whenever i install it on someone elses machine, it installs
fine, but when it gets to the part where it connects to the DB it fails
and says "Invalid connection string attribute"

Ive been looking about the net and all i really found was that in
c:\windows\assembly i have something called ADODB, but this isnt
present on the other machines ive installed it on.

Any ideas?

Nov 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Give ur server IP instead of host name

"Ames111" wrote:
Hi

I have an application that connects to a SQl database on my computer
via an ADODB connection:

ADODB.Connection Conn = new ADODB.Connection();

Conn.ConnectionString = ("Driver={SQL
Server};Server=4P-12.Leighton.local;Database=HD;Uid=l0073;Pwd=cheese ");

Conn.Open(dbconnection, "", "", -1);

ADODB.Recordset rs = new ADODB.Recordset();
rs.Open("SELECT * from [HD-Users]", Conn,
ADODB.CursorTypeEnum.adOpenStatic,
ADODB.LockTypeEnum.adLockBatchOptimistic, 1);

This works fine when running from the code, or even deploying it and
installing on my machine.

However whenever i install it on someone elses machine, it installs
fine, but when it gets to the part where it connects to the DB it fails
and says "Invalid connection string attribute"

Ive been looking about the net and all i really found was that in
c:\windows\assembly i have something called ADODB, but this isnt
present on the other machines ive installed it on.

Any ideas?

Nov 23 '05 #2

P: n/a
Ok i changed it to the IP address but its timing out. i Also simplified
the connection to

ADODB.Connection Conn = new ADODB.Connection();
Conn.Open("Driver={SQL
Server};Server=xxx.xxx.xx.xx;Database=HD","l0073", "cheese",-1);
ADODB.Recordset rs = new ADODB.Recordset();
it seems to work on machines on the network that have ADODB in the
c:\windows\Assembly folder, and it doesnt work on machines that dont
have this.

Im pretty sure im deploying the application correctly, but im not sure
if its supposed to somehow put the ADODB 'THING' in the assembly folder

Nov 23 '05 #3

P: n/a
fixed now. To get the ADODB in assembly i had to install it throught
the office 2003 setup as part of the .net framework for office....or
summit, it works anyway. thanks for your help

Nov 23 '05 #4

P: n/a
A bigger question would be: why, in C#, are you using ADODB? You should
probably be using ADO.Net, which is accessed via the System.Data
namespace... this avoids the interop hop, the prerequisite of ADODB, and is
just quicker...

e.g. (using the SqlClient provider)

using (System.Data.IDbConnection conn = new
System.Data.SqlClient.SqlConnection("your connection string")) {
conn.Open();
// and then use a data-reader or a data-set to get at your
data - see google...
}

"Ames111" <an*********@4projects.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
Ok i changed it to the IP address but its timing out. i Also simplified
the connection to

ADODB.Connection Conn = new ADODB.Connection();
Conn.Open("Driver={SQL
Server};Server=xxx.xxx.xx.xx;Database=HD","l0073", "cheese",-1);
ADODB.Recordset rs = new ADODB.Recordset();
it seems to work on machines on the network that have ADODB in the
c:\windows\Assembly folder, and it doesnt work on machines that dont
have this.

Im pretty sure im deploying the application correctly, but im not sure
if its supposed to somehow put the ADODB 'THING' in the assembly folder

Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.