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

URGENT!!!! SQL Server Not Found

Status
Not open for further replies.

sane79

MIS
Nov 18, 2003
60
SG
Hi all...

I'm very new to crystal report and I have a problem here..
I'm trying to create a program to generate reports using crystal report 8.5 from VB6 with parameter passing.

Have done the linking.. but when I tried running the program, I get the error 'SQL Server not found'

However, everything works fine when I try to preview the report from Crystal Report itself. Below is my code from VB.
Can anyone tell me what's wrong?
Thanks.


Set crptApp = New CRPEAuto.Application
Set crptRpt = crptApp.OpenReport(App.Path & "\test1.rpt")
Set rptDB = crptRpt.Database
Set rptTbls = rptDB.Tables
Set rptTbl = rptTbls.Item(1)
rptTbl.SetLogOnInfo "dsn=reportdb"

Set crptParaFDs = crptRpt.ParameterFields
Set crptParaFD = crptParaFDs.Item(1)

crptParaFD.SetCurrentValue CStr(dtCommFrmDate.Value)

Set crptParaFD = crptParaFDs.Item(2)
crptParaFD.SetCurrentValue CStr(dtCommToDate.Value)

crptRpt.Preview

Set crptParaFD = Nothing
Set crptParaFDs = Nothing
Set crptRpt = Nothing
Set crptApp = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top