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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR Change database location at run time vb6 help!!!! 1

Status
Not open for further replies.

bmeza

MIS
Dec 2, 2005
7
MX
Hi
I have a report that use Microsoft sql server to connect at data base and I want to change the data base at run time in vb6.0; But I always get the data base that I put in cr at set location here its my code:

For Each crxDBTable In Reporte.Database.Tables
crxDBTable.SetLogOnInfo GsServidor1, GsBaseDatos1, GsUsuario1, GsPassword1

I = InStr(crxDBTable.Location, ".")
If I = 0 Then
crxDBTable.Location = GsBaseDatos1 & ".dbo." & crxDBTable.Location
Else
crxDBTable.Location = GsBaseDatos1 & Mid$(crxDBTable.Location, I)
End If
If Not crxDBTable.TestConnectivity Then
sMsg = "Unable to connect to database."
Set crxreporte = Nothing
Set crxApp = Nothing
End
End If
Next

do i have to change the server type or something its wrong whit my code?
 
What version of CR? See faq768-5374, and if you're using CR9 or higher, pay attention to the addendum toward the end of the FAQ.

-dave
 
vidru thaks, im usigng cr8.5 and vb6, and i try before that solutions but i still comming the database set by default... do you now another solutions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top