Click to See Complete Forum and Search --> : VB 6 Connection Problem


TheLimp
June 13th, 2008, 09:59 AM
Hi,

I have trawled the internet for days trying to find a solution to this problem but to no avail.

I am using CR XI, VB6, SQL Server 2000

I have a PC and a laptop. SQL Server sits on the Laptop.
The Report uses an OLE DB ADO connection.

When opening the report on either computers in CR XI it connects correct when user name a password are entered.

When opening the report on the Laptop via VB6 it works correclty

THe problem is when I try to open the report on my PC via VB6. It uses the exact same code as is running on the laptop but it returns the following error:

Logon failed.
Details: [Database Vendor Code: 18456 ]

Below is the code:

Dim crConnectionProp As CRAXDRT.ConnectionProperties
Dim crSection As CRAXDRT.Section
Dim crSections As CRAXDRT.Sections
Dim crxSubreportObject As Variant
Dim crxSubreport As Variant
Dim aReport As Variant
Dim sTableName As String
On Error GoTo Hell
sCurProc = "LoadReport"

Set crApp = New CRAXDRT.Application

aReport = GetReport(sReport)

Set crReport = crApp.OpenReport(aReport(0))
Set crTables = crReport.Database.Tables

crReport.Database.Tables(1).DllName = "crdb_ado.dll"

For Each crTable In crTables
Set crConnectionProp = crTable.ConnectionProperties
sTableName = crTable.Location
crConnectionProp.DeleteAll

crConnectionProp.add "Provider", "SQLOLEDB"
crConnectionProp.add "Date Source", sSQLServer
crConnectionProp.add "Initial Catalog", sDSN
crConnectionProp.add "User ID", sUID
crConnectionProp.add "Password", sPassword
crConnectionProp.add "INTEGRATED SECURITY", False
crTable.Location = sDSN & ".dbo." & sTableName
Next
This Line is where the error occurs.

The Server, database name etc are all correct.

The other things is I dont think this is a Database problem but I could be wrong here... "Details: [Database Vendor Code: 18456 ]" indicates its a Database problem but this error does not appear in the Server logs..!

Can anyone help me out here. Im pulling my hair out!

Cheers