Question Locked

vb6.0 + ADO + Win Vista = Erro 2147467259

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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!

6 replies

by tostafig

Thanks Tony!
Yes, connection string is the point.

Today try add parameter "Persist Security Info=True" to connection string, I never use that parameter before, now is working! :)

by gderas2

Thanks for share the information, now is working!

by tostafig

Thanks Tony!
Yes, connection string is the point.

Today try add parameter "Persist Security Info=True" to connection string, I never use that parameter before, now is working! :)

by pavleb_grp

"Persist Security Info=True" Fixed the problem for us too. Thanks

This discussion is closed to new replies.