Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.net framework db connections fail on test box

Status
Not open for further replies.

hsandwick

Programmer
Sep 10, 2001
286
US
VB .net 2002
crystal reports 9
.net framework 1.1

All connections worked on my box. Having compiled the application and run the .exe on a test box, I find all three db connections now fail. The MS documentation advised to include "Imports Microsoft.Data.Odbc" but that was not an option in my environment, so I tried "Imports Microsoft.VisualBasic.OpenAccess" in my vb file. It didn't work.
My connections to the 3 dbs are:
1. An odbc system connection using the format ...
Dim crDatabase As Database
Dim item As String
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo
Dim subrpt As New ReportDocument()
With crConnectionInfo
.DatabaseName = ""
.Password = "xx"
.ServerName = "xxx"
.UserID = "xx"
End With

2. Dim m_cnADONetConnection As New OleDb.OleDbConnection()
m_cnADONetConnection.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=YYYYYYY\yy\ABC.mdb"

3. Dim m_cnADONetConnection2 As New OleDb.OleDbConnection()
m_cnADONetConnection2.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;DataSource=BBBBBBBBBBB\bbbbbbbbbb\CC.mdb;"

Please help! What do I need to do now to make this work?
Much appreciated,
-Helen
 
Thanks, baddos,

Yes, I do. I'm looking at the testbox environment - the regular odbc administrator seems to be missing from the control panel. I didn't know if the .net framework environment handled everything with its own odbc download; seems I must also need the regular odbc admin. Will try that.
-H
 
If you are using ODBC.Net, you also have to reference it.
 
OK, RiverGuy, some progress made, but still unsuccessful in TEST.

I've tried many scenarios, they all work on DEV, and not on TEST.

I've installed .net framework 1.0, mdac, and odbc .net data provider on TEST. Still shows log in box requesting uid and then won't let me connect to the db and report, but this shouldn't show, should go straight to the crystal report 9.

I've installed .net framework 1.1, as both are on DEV (1.1 is for vstudio 2003, though, right, and I really only need 1.0 for 2002 which is what I'm using, right?)

DEV is fine, TEST is not.

It must be something in the environment, different novell setups, network permissions or something. Any suggestions at all? I've GOT to get this working!!

To use odbc in .net, I found from the web that I needed to include microsoft.data.odbc.dll that was missing.

Now I have
Imports.System.Data
Imports.Microsoft.Data.ODBC - working!

Dim cn As ODBCConnection
cn = new odbcconnection("DRIVER={Microsoft Access Driver {*.mdb)};" &
"PWD=mypassword;DATABASE=abc;")

Do I also need to link to something in the db to make it work, such as
dim mystring as string = "Select * from deftable".
Someone advised I needed to do this; I thought it was enough to make the connection. It is in DEV.

If anyone can help, I'd be v. grateful. Thank you!

-H
 
I am getting the same problem, except I am using ADODB. Basically I get an error that the provider is not installed when attempting to login to my application, which uses a MS Access backend.

I have not yet been able to resolve this. I have 4 test machines, the application functioned on those. Sent it to another department and the application fails bigtime. ADODB.DLL is stored in the same directory as the executable, so it is not related to that. Hopefully I will work something out and let you know.

Cam.
 
So I am not alone in this world! Thank you, CamBooth. If I get a response from elsewhere, too, I'll be sure to post it.

-H
 
Are you running this application accross a network share, or is it installed on the test box's local c: drive?
 
The applications's release was copied over to a shared drive, I ran the .exe and the files reside on the TEST c drive, and I run the app from its desktop shortcut.

The dbs I am attempting to reach are on network share. It was challenging getting these to work at all on DEV, I hoped after that struggle all was well, but here we are again. Do you think it's ip permissions and so on?

What are you thoughts? Thanks so much!

-Helen
 
It could be permissions. Also, remember that the .NET framework places restrictions on apps that aren't installed on the local PC's physical drives.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top