|
-
Jul 23rd, 2003, 11:01 PM
#1
Thread Starter
Junior Member
"Server has not yet open" after excuation of program
I am trying to change database, please find out where did I go wrong...... It say "Server has not yet open" after excuation of program.
Dim crApplication As CRAXDRT.Application
Dim crReport As CRAXDRT.report
Dim adoCN As New ADODB.Connection
Dim ADOrs As New ADODB.Recordset
Private Sub Form_Load()
Dim cnSTR, Path, STRsql As String
cnSTR = gConnection
Set adoCN = New ADODB.Connection
Set ADOrs = New ADODB.Recordset
Path = Mid(App.Path, 1, (Len(App.Path))) & "\report\FINAL\Entry Form.rpt"
Set crApplication = New CRAXDRT.Application
Set crReport = crApplication.OpenReport(Path)
With adoCN
.ConnectionString = cnSTR
.CursorLocation = adUseClient
.Open
End With
STRsql = "SELECT " & _
"tblbio.st_indexno, tblbio.st_name, tblbio.st_gdname, tblbio.st_sex," & _
"tblbio.st_gd_occ, tblbio.st_nation, tblbio.st_type, tblbio.st_dbirth," & _
"tblbio.st_cidno, tblbio.st_prv_idx, tblbio.st_add," & _
"tblschool.schoolname,tblecenter.ecenter,tbldzongkhag.dzongkhag " & _
"From " & _
" " & gDBase & ".dbo.tblbio tblbio," & gDBase & ".dbo.tblschool tblschool," & _
"" & gDBase & ".dbo.tblecenter tblecenter," & gDBase & ".dbo.tbldzongkhag tbldzongkhag" & _
" Where" & _
" tblbio.st_sc_id = tblschool.st_sc_id AND tblschool.ec_id = tblecenter.ec_id AND" & _
" tblschool.dzo_id = tbldzongkhag.dzo_id" & _
" Order By" & _
" tblschool.schoolname ASC,tblbio.st_indexno Asc"
With ADOrs
.ActiveConnection = adoCN
.CursorType = adOpenDynamic
.Open STRsql
End With
crReport.Database.SetDataSource ADOrs, 3, 1
CRViewer1.ReportSource = crReport
CRViewer1.ViewReport
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|