473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C# - ADODB - Failure to connect on deployment

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
4 5488
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: TK | last post by:
I have a problem getting ADOdb working with Oracle 9i. Before I tried to connect to Oracle, I successfully connected to an MS Access table via a DSN, and looped through all the records in that...
1
by: liorh | last post by:
my code is using ADODB connection to connect to SQL (Virtual) Server. the way it being done is (c++): ADODB::_ConnectionPtr m_dbConn; ADODB::_RecordsetPtr m_dbRst;...
5
by: DEWright_CA | last post by:
I have a app that I built for a client. I was able to deploy it to a test server without any real issue. I copied the bin folder to my server, copied over the aspx pages and made the virtual...
0
by: Michael | last post by:
After a week of beating my head against a wall I still continue to receive the following error message when trying to deploy a package using the cabinet option. The same error occurs with a...
6
by: Wonder | last post by:
We have a VB.NET project with a reference to ADO 2.5 When I open it on my machine, I get the following build error: "The referenced component 'ADODB' has an updated custom wrapper available." ...
0
by: Marty Cruise | last post by:
I successfully deploy my application to 20 domain users. Only one new user is giving me a problem, although he can access all domain resources. When he clicks the installation link on the...
0
by: =?Utf-8?B?R2lvdmFubmk=?= | last post by:
Hi, I am using VS 2005, .NET 2.0 and have the following problem: I have created a simple WinForms application and have added a reference to the ADO Interop PIA library;(ADODB.dll). When I add...
7
by: boyleyc | last post by:
Hi all I have written a database in access and used ADODB recordsets all the way through. The only recordsets that are not ADODB are the listbox navigation code automatically generated by access...
7
by: trpost | last post by:
I just started using the php adodb library for my Oracle transactions, but am running into a problem when there are 2 simultaneous requests going on at the same time. The nature of the php app...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.