General information
Category:
Coding, syntax & commands
Title:
Error in Access not MS-SQL
Hi,
Any body can help to my code which got an error "Method 'Open' of object '_recordset' failed....
Private Sub Command1_Click()
Dim RS As ADODB.Recordset
Dim strConn As String
Catalog=BackOffice;Data Source=(local)"
Set RS = New ADODB.Recordset
RS.CursorLocation = adUseClient
RS.CursorType = adOpenDynamic
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Toping\Miner\BackOffice.mdb;Persist Security Info=False"
RS.Open "SELECT SaleMaster.STRCDE, SaleMaster.PRTYP, DeptDesc.ITMDESC, " & _
"SaleMaster.SCDE, SaleMaster.COLOR, SaleMaster.SIZE, SaleMaster.SLEDTE, " & _
"SaleMaster.SLQTY, SaleMaster.CSAMT, SaleMaster.CDAMT, SaleMaster.discount, " & _
"SaleMaster.INVNO, SaleMaster.BCODE " & _
"From DeptDesc, SaleMaster " & _
"Where SaleMaster.PRTYP = DeptDesc.PRTYP " & _
"ORDER BY SaleMaster.PRTYP", strConn, adOpenDynamic, adLockPessimistic
Dim rptApp As CRAXDRT.Application
Dim rptReport As CRAXDRT.Report
Dim rptDatabase As CRAXDRT.Database
Set rptApp = New CRAXDRT.Application
Set rptReport = rptApp.OpenReport("C:\MontlhySalesSummarybyDepartment 1.rpt")
rptReport.Database.SetDataSource RS, 3, 1
'rptDatabase.SetDataSource RS, 3, 1 '
CRViewer1.ReportSource = rptReport
CRViewer1.ViewReport
End Sub
NOTE:
if i used my connection to ms-sql theres no error...
TIA
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only