dev connections work, test does not

G

Guest

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
 
P

Paul Clement

¤ 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

What is the error you are encountering when the connection fails?

Just a recommendation, do not use ODBC but Jet OLEDB as illustrated in examples two and three.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
P

Paul Clement

¤ Hi, Paul:
¤
¤ Yes, I'd heard that before - stay away from ODBC! I was using ole and it worked. Then, because the app was failing on my test box, I thought I'd try another way, hence my efforts with odbc. Whatever works, really, at this point!
¤
¤ In test, what is happening is that the login generic box appears when I run the .exe. I put in a great deal of effort on my DEV box preventing this from showing. The connections have all been troublesome from the beginning, and finally I achieved success in DEV, and the login box didn't pop up. The main form appears, I click on my option of which report I'd like to see, and a second form appears that loads the crystal report. All connections and ids are done behind the scenes.
¤
¤ The error is that the login box appears, and even then if I enter server/database/uid/pwd detail, it kicks me out. It seems to be connecting to connection information somewhere that doesn't relate to the application.
¤
¤ Tks for your time and effort in helping.
¤

Can I assume that the login dialog is for the Access database and not for a linked table to another
database (such as SQL Server)?

If you are implementing user-level security for your Access database then it's possible that the
system.mdw file cannot be located. Would this be a possibility?


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top