I have an aplication developed in VB6.0, wok fine in win 98, ME, XP, 2000, 2003, but now dont work in Win Vista.
After hours trying resolve the problem, installing MDAC 2.7 and 2.8 , set debug points in code, I have identify where is the bug but I dont know the solution. Fowlling is the code:
———————————————–
Private Function ConnectToMyDatabaseSF() As ADODB.Connection
On Error GoTo erro
Dim conn As Connection
Dim connStr As String
Dim errNum As Long
Dim errDesc As String
Dim X As String
connStr = ConnectionString(“MyDataBase”) ‘ is to get and make a connectionstring
MsgBox connStr
Set conn = New Connection
With conn
.ConnectionString = connStr
.CursorLocation = adUseClient
.open
End With
Set ConnectToMyDatabaseSF= conn
MsgBox conn.ConnectionString
Exit Function
erro:
‘ My error handling
end function
———————————————–
In Win XP, 2000:
The first messagem is: “driver={SQL Server};server=myServerName;database=MyDatabase;uid=sa;pwd=mysapass”
the second message is: Provider=MSDASQL.1;Extended Properties=”DRIVER=SQL Server;SERVER=myServerName;UID=sa;PWD=mysapass;APP=Visual Basic;WSID=myServerName;DATABASE=MyDatabase”
In Win Vista:
The first messagem is: “driver={SQL Server};server=myServerName;database=MyDatabase;uid=sa;pwd=mysapass”
the second message is: “Provider=MSDASQL.1;”
Why is connectionstring truncated in win vista?
Any sugestion to solve this?
thanks!