I keep getting a cursor operation conflict when calling the "Update" method
of a recordsetup object using VB6 with a SQL Server 2000 DB. I have 0
"INSTEAD OF" triggers in the database, my user options are set to 0. I am
running MDAC 2.81.117.0 on a Win XP SP2 machine against a Win 2003 Server
with SQL Server 2000 SP 4. This didn't happen in previous versions of our
software, indicating to me that the software has changed somewhere. I've
looked through the software and nothing different stands out. If I change t
o
a client-side cursor it works ok. The data is still saved with a server sid
e
cursor, but I get the error message "Cursor Operation Conflict". There are
no triggers on the table that I'm inserting into.UPDATE: I'm now using a "NOT IN" in one portion of our software and that
seems to be causing the cursor operation conflict in other portions of the
software. I'm not sure why, but my syntax is "KeyField NOT IN (400, 390)",
which the records return fine both in VB and Query Analyzer, but when I try
to add/update a record in other parts of the software then I get the error.
If I exclude the "NOT IN" then no errors elsewhere.
"John Estrada" wrote:
> I keep getting a cursor operation conflict when calling the "Update" metho
d
> of a recordsetup object using VB6 with a SQL Server 2000 DB. I have 0
> "INSTEAD OF" triggers in the database, my user options are set to 0. I am
> running MDAC 2.81.117.0 on a Win XP SP2 machine against a Win 2003 Server
> with SQL Server 2000 SP 4. This didn't happen in previous versions of our
> software, indicating to me that the software has changed somewhere. I've
> looked through the software and nothing different stands out. If I change
to
> a client-side cursor it works ok. The data is still saved with a server s
ide
> cursor, but I get the error message "Cursor Operation Conflict". There ar
e
> no triggers on the table that I'm inserting into.
Showing posts with label vb6. Show all posts
Showing posts with label vb6. Show all posts
Tuesday, March 27, 2012
Tuesday, February 14, 2012
Crystl32 ocx vanished ???
Hi. I'm puzzled. I can't reference to CR from within VB6. I have both
VB6 and VS.Net installed on my machine, and from VB.NET I can insert
the component Crystal Reports (which sets a refernce to C:\Program
Files\Common Files\Crystal
Decisions\1.0\Managed\CrystalDecisions.CrystalReports.Engine.dll which
is version 9.1.3300.0. However, from within VB6 I can't set any
reference to this dll.
I have not really used Crystal Reports from VB6 before, so I don't know
how to do it. I know for sure that it is possible to do it, though, so
I'm trying.
The client does not want to use .Net (actually, some of the machines
this little utility program will be installed on are running Win98), so
I need to use VB6.
I searched my drive for any OCX ressembling Crystal, and I couldn't
find anything. When I tried to reference the above-mentioned dll, VB6
says "Can't add a reference to the specified file". I thought that
maybe when I installed VS6 I forgot to install Crystal as an option,
but no, Crystal is not even mentioned in the installation routine.
Please tell me, how can I start producing a report from VB6 ?
>From within VB6/References I can only see (under "C") the dlls from
C:\Program Files\Common Files\Crystal Decisions\1.0\Managed\, which I
can't use. In other words, I can't find any CR COM object....
>From VB6/Components/Insertable Objects I only see Crystal Analysis
Common Controls 1.0. In VB6/Components/Controls and
VB6/Components/Designers, nothing.
I tried to browse my drive for anything ressembling CR, to no avail.
Please help...
Thank you very much, Alex.That is because the CR that is bundled with .NET is a lite version of CR. Not to mention that is is the .NET compatible version and should give the errors when trying to reference from a VB6 project. You need the Full version of CR so it will be available in either development environment.|||Yes, thank you, Rob, but it's still confusing: VB6 did not come with a crystl32.ocx (of some version, whatever that might have been) ? I do *NOT* want to necessarily use the .NET version - the old (vb6) version would do jut fine, in this particular case..
Thanks again for you time.
Alex.|||If you are using vb6 there still may be something you can do. On the VB6 CD there is a old version of the CR ocx. I think its Crystal.ocx or Crystal32.ocx version 4.6. I dont think its that powerful but if your only needing something basic it may help.
VB6 and VS.Net installed on my machine, and from VB.NET I can insert
the component Crystal Reports (which sets a refernce to C:\Program
Files\Common Files\Crystal
Decisions\1.0\Managed\CrystalDecisions.CrystalReports.Engine.dll which
is version 9.1.3300.0. However, from within VB6 I can't set any
reference to this dll.
I have not really used Crystal Reports from VB6 before, so I don't know
how to do it. I know for sure that it is possible to do it, though, so
I'm trying.
The client does not want to use .Net (actually, some of the machines
this little utility program will be installed on are running Win98), so
I need to use VB6.
I searched my drive for any OCX ressembling Crystal, and I couldn't
find anything. When I tried to reference the above-mentioned dll, VB6
says "Can't add a reference to the specified file". I thought that
maybe when I installed VS6 I forgot to install Crystal as an option,
but no, Crystal is not even mentioned in the installation routine.
Please tell me, how can I start producing a report from VB6 ?
>From within VB6/References I can only see (under "C") the dlls from
C:\Program Files\Common Files\Crystal Decisions\1.0\Managed\, which I
can't use. In other words, I can't find any CR COM object....
>From VB6/Components/Insertable Objects I only see Crystal Analysis
Common Controls 1.0. In VB6/Components/Controls and
VB6/Components/Designers, nothing.
I tried to browse my drive for anything ressembling CR, to no avail.
Please help...
Thank you very much, Alex.That is because the CR that is bundled with .NET is a lite version of CR. Not to mention that is is the .NET compatible version and should give the errors when trying to reference from a VB6 project. You need the Full version of CR so it will be available in either development environment.|||Yes, thank you, Rob, but it's still confusing: VB6 did not come with a crystl32.ocx (of some version, whatever that might have been) ? I do *NOT* want to necessarily use the .NET version - the old (vb6) version would do jut fine, in this particular case..
Thanks again for you time.
Alex.|||If you are using vb6 there still may be something you can do. On the VB6 CD there is a old version of the CR ocx. I think its Crystal.ocx or Crystal32.ocx version 4.6. I dont think its that powerful but if your only needing something basic it may help.
CrystalReports in VB6
Hello,
I want to display a Crystalreport in VB6.
When i develop a Crystalreport a form is added with the following ocde:
Dim Report As New CrystalReport1
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
There is a parameter which should be sended to this report in order to collect to correct recordset from our SQLserver.
The Fieldname is CrystalReport1.Field1
Does anyone know how to do this?
Hope to hear from anyone.
Thanks in advance,
XanderPublic Sub CreateNewViewerWithParametersForDateAndDept(SelectionFormula As String, ReportPath As String, sStartDate As String, sStopDate As String, sDept As String, SingleDate As Boolean)
On Error GoTo CreateNewViewerError
Dim miReport As CRAXDDRT.Report
Dim miCRApp As New CRAXDDRT.Application
Dim DBTable As CRAXDRT.DatabaseTable
Set miReport = miCRApp.OpenReport(ReportPath)
Dim sDataBasePath As String
sDataBasePath = App.Path & "\Commercial.mdb"
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
'Set the Connection Info to Connection Properties of the table object
Set ConnectionInfo = miReport.Database.Tables(1).ConnectionProperties
'Clear the ConnectionProperties collection.
ConnectionInfo.DeleteAll
'Add the database used by the report
ConnectionInfo.Add "Database Name", sDataBasePath
Set DBTable = miReport.Database.Tables(1)
DBTable.Location = sDataBasePath
With miReport
If (Len(SelectionFormula) > 0) Then
.RecordSelectionFormula = SelectionFormula
End If
If Not (SingleDate) Then
.ParameterFields(2).AddCurrentRange CDate(sStartDate), CDate(sStopDate), crRangeIncludeLowerBound + crRangeIncludeUpperBound
Else
.ParameterFields(2).AddCurrentValue CDate(sStartDate)
End If
.ParameterFields(4).AddCurrentValue (sDept)
If Not (ReportTitle = Empty) Then
.Sections("PH").ReportObjects("SummaryOfPayPeriod").SetText ReportTitle
End If
.Sections("PH").ReportObjects("Department").SetText "Dept." & sDept
End With
With ENG.crvCommercial
.ReportSource = miReport
.ViewReport
.DisplayGroupTree = False
.EnableProgressControl = True
While .IsBusy
DoEvents
Wend
.Zoom "100"
.Visible = True
End With
Set miCRApp = Nothing
Set miReport = Nothing
ENG.chkIndiviual.Value = 0 'Make sure that the Print command is cleared
ENG.MousePointer = vbDefault
Exit Sub
CreateNewViewerError:
MsgBox Err.Description, vbInformation, "Error"
Set miCRApp = Nothing
Set miReport = Nothing
ENG.chkIndiviual.Value = 0 'Make sure that the Print command is cleared
ENG.MousePointer = vbDefault
End Sub
LEGEND:
CreateNew Viewer With Parameters For Date And Dept
SelectionFormula As String = Created Selection formula.
ReportPath As String = Where and what report you want to use.
sStartDate As String = Start Date of selection.
sStopDate As String = Ending Date of selection
sDept As String = What Department
SingleDate As Boolean = Is only a single date required.
I use this function to create a viewer for my reports based on certain paramters that are selected by the user. This function is a part of a program that I wrote for the company that I work for. It will track TimeSheets for technicians and create reports based on the data. This program is in VB6 SP6 and Crystal 9.|||This should work:
Report.ParameterFields(1).AddCurrentValue (Value)
the number between () is the index (first one is 1, second 2,....)
in "Value" you have to put the value of the parameter field.
I want to display a Crystalreport in VB6.
When i develop a Crystalreport a form is added with the following ocde:
Dim Report As New CrystalReport1
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
There is a parameter which should be sended to this report in order to collect to correct recordset from our SQLserver.
The Fieldname is CrystalReport1.Field1
Does anyone know how to do this?
Hope to hear from anyone.
Thanks in advance,
XanderPublic Sub CreateNewViewerWithParametersForDateAndDept(SelectionFormula As String, ReportPath As String, sStartDate As String, sStopDate As String, sDept As String, SingleDate As Boolean)
On Error GoTo CreateNewViewerError
Dim miReport As CRAXDDRT.Report
Dim miCRApp As New CRAXDDRT.Application
Dim DBTable As CRAXDRT.DatabaseTable
Set miReport = miCRApp.OpenReport(ReportPath)
Dim sDataBasePath As String
sDataBasePath = App.Path & "\Commercial.mdb"
Dim ConnectionInfo As CRAXDRT.ConnectionProperties
'Set the Connection Info to Connection Properties of the table object
Set ConnectionInfo = miReport.Database.Tables(1).ConnectionProperties
'Clear the ConnectionProperties collection.
ConnectionInfo.DeleteAll
'Add the database used by the report
ConnectionInfo.Add "Database Name", sDataBasePath
Set DBTable = miReport.Database.Tables(1)
DBTable.Location = sDataBasePath
With miReport
If (Len(SelectionFormula) > 0) Then
.RecordSelectionFormula = SelectionFormula
End If
If Not (SingleDate) Then
.ParameterFields(2).AddCurrentRange CDate(sStartDate), CDate(sStopDate), crRangeIncludeLowerBound + crRangeIncludeUpperBound
Else
.ParameterFields(2).AddCurrentValue CDate(sStartDate)
End If
.ParameterFields(4).AddCurrentValue (sDept)
If Not (ReportTitle = Empty) Then
.Sections("PH").ReportObjects("SummaryOfPayPeriod").SetText ReportTitle
End If
.Sections("PH").ReportObjects("Department").SetText "Dept." & sDept
End With
With ENG.crvCommercial
.ReportSource = miReport
.ViewReport
.DisplayGroupTree = False
.EnableProgressControl = True
While .IsBusy
DoEvents
Wend
.Zoom "100"
.Visible = True
End With
Set miCRApp = Nothing
Set miReport = Nothing
ENG.chkIndiviual.Value = 0 'Make sure that the Print command is cleared
ENG.MousePointer = vbDefault
Exit Sub
CreateNewViewerError:
MsgBox Err.Description, vbInformation, "Error"
Set miCRApp = Nothing
Set miReport = Nothing
ENG.chkIndiviual.Value = 0 'Make sure that the Print command is cleared
ENG.MousePointer = vbDefault
End Sub
LEGEND:
CreateNew Viewer With Parameters For Date And Dept
SelectionFormula As String = Created Selection formula.
ReportPath As String = Where and what report you want to use.
sStartDate As String = Start Date of selection.
sStopDate As String = Ending Date of selection
sDept As String = What Department
SingleDate As Boolean = Is only a single date required.
I use this function to create a viewer for my reports based on certain paramters that are selected by the user. This function is a part of a program that I wrote for the company that I work for. It will track TimeSheets for technicians and create reports based on the data. This program is in VB6 SP6 and Crystal 9.|||This should work:
Report.ParameterFields(1).AddCurrentValue (Value)
the number between () is the index (first one is 1, second 2,....)
in "Value" you have to put the value of the parameter field.
Subscribe to:
Posts (Atom)