ADO Parameter Query

ADO Parameter Query

Post by Dale Side » Wed, 09 Dec 1998 04:00:00

I am using VB 6, connecting to an Oracle 8.0 database with ADO OLEDB
I want to create a few stored Parameter Queries, is this possible?

1. slow ado parameter query

My knowledge of VB is still very weak.
I am writing small apps that work with data in a SQL7 database.
I am using ADO code, and basically using parameters in shaped queries.
The apps do what I want, but they are very slow.
The same query in analyser is takign a few seconds, in my app a few minutes.
Could someone please tell me what would be my best approach to work on the performance of these apps.
Here is an example of soem of the code i am using:

Set cn = New ADODB.Connection
  cn.CursorLocation = adUseClient
  cn.Open "PROVIDER=MSDataShape;Data PROVIDER=MSDASQL;dsn=ICBIND;uid=sa;pwd=SQUID1;database=ISLTD;"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "SHAPE {select SOPTYPE,SOPNUMBE,DOCDATE,CUSTNMBR,CUSTNAME,CSTPONBR,SUBTOTAL_,DOCAMNT,SLPRSNID,COMMNTID from SOP30200 where CSTPONBR_ = '" & txtEntered.Text & "' } AS ParentCMD APPEND ({select_ SOPNUMBE,ITEMNMBR as Item,ITEMDESC as Description,QUANTITY_ as Qty_Ordered,QTYFULFI as Qty_Fulfilled,UNITPRCE as Price_ from SOP30300 } AS ChildCMD RELATE SOPNUMBE TO SOPNUMBE) AS_ ChildCMD", cn, adOpenStatic, adLockOptimistic
  If adoPrimaryRS.EOF Then
MsgBox "Purchase order Not found, check to see if posted"
    Dim oText As TextBox
  'Bind the text boxes to the data provider
  For Each oText In Me.txtFields
    Set oText.DataSource = adoPrimaryRS
  ' Binds data to grid
  Set DataGrid1.DataSource = adoPrimaryRS("ChildCMD").UnderlyingValue
  mbDataChanged = False
  End If

As far as I know I am using all the latest references.
I have seen stored procedures mentioned, i know how to write them in SQL, not sure how to use them via VB, or is there another way to speed this up?
Any help would be greatly appreciated.


*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!

2. odbc drivers for as/400 vsam

3. ADO parameter query

4. ORACLE: Trouble inserting record with a column default value

5. calling parameter query from a parameter query

6. Error in SDK Application running on a server

7. How can I query a stored procs Input/Output parameters using ADO

8. DTS

9. ADO & Access 2000 parameter queries

10. ADO 2.0 and Access Parameter Queries

11. ADO and Access Multiple Parameter Queries

12. query with parameter with ADO

13. query with parameters in ADO