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

Help : Runtime & using Ocx

Status
Not open for further replies.

tblazzer

Programmer
May 10, 2000
2
FR
Sorry for my English (I'm French).<br>My reports are OK when I run them with my Visual basic 5.0 application on my developpement PC (CR 8.0 installed). <br>They're also OK inside the CR 8.0 developpment tool.<br>When I run a VB 5.0 setup program on another PC without CR 8.0, they aren't working, error message : 'Unable to open the sql server'. <br>I'm using the OCX method. <br>Does somedy have any idea of what happens ?<br><br>Regards,<br><br>Here's a sample of the VB code :<br><br>With frmMDI.CRControl<br><br>&nbsp;&nbsp;&nbsp;&nbsp;.Reset<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;.ReportFileName = gsReportPath & &quot;\&quot; & CStr(vEtat(0))<br>&nbsp;&nbsp;&nbsp;&nbsp;.Connect = &quot;DSN=&quot; & sServeur & &quot;;UID=&quot; & sUser & &quot;;PWD=&quot; & sPwd & &quot;;DSQ=&quot; & sBase<br>&nbsp;&nbsp;&nbsp;&nbsp;.CopiesToPrinter = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;.DiscardSavedData = True<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;.WindowTitle = CStr(vEtat(2))<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Formulas(0) = &quot;CR_Selection = '&quot; & gsCodeUtilisateur & &quot;'&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Formulas(1) = &quot;CR_Environnement = '&quot; & APP_ResolveString(ressource(672), &quot;¦1&quot;, vbTab & gsEnvironnement) & &quot;'&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Formulas(2) = &quot;CR_Utilisateur = '&quot; & APP_ResolveString(ressource(673), &quot;¦1&quot;, vbTab & gsUtilisateur) & &quot;'&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Formulas(3) = &quot;CR_DateAppli = '&quot; & APP_ResolveString(ressource(670), &quot;¦1&quot;, frmMDI.pnl3Dheure) & &quot;'&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Formulas(4) = &quot;CR_DateRPT = '&quot; & APP_ResolveString(ressource(671), &quot;¦1&quot;, Format(Date, &quot;Long Date&quot;) & &quot; &quot; & Format(Time, &quot;Long Time&quot;)) & &quot;'&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;iNumFla = 5<br>&nbsp;&nbsp;&nbsp;&nbsp;For iCpt = 1 To UBound(vEtat) Step 2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Formulas(iNumFla) = CStr(vEtat(iCpt)) & &quot; = '&quot; & CStr(vEtat(iCpt + 1)) & &quot;'&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;iNumFla = iNumFla + 1<br>&nbsp;&nbsp;&nbsp;&nbsp;Next iCpt<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Destination = crptToWindow 'Aperçu<br>&nbsp;&nbsp;&nbsp;&nbsp;.WindowState = crptMaximized<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;.Action = 1 <br>&nbsp;<br>
 
Hija<br><br>I know this is an old post, but anyway ....<br><br>Are you sure that the correct ODBC sources with the SAME name exists on the other machine? As the DSN is the ODBC name, it must be exactly the same!<br><br>I hope this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top