Stored procedure with VB6, ADO, ODBC, and Informix 7.2 
Author Message
 Stored procedure with VB6, ADO, ODBC, and Informix 7.2

I am writing an application in VB6 using ADO.  The app needs to execute a
stored procedure in the Server.  The procedure accepts two parameters, a
string and a integer.  The Server is a SUN running Informix 7.3.  Following
the examples from MSDN I have developed the following code.

Public Function StrPscd(ThisPnCdId As Long) As Long

Dim cmdStrPscd As ADODB.Command
Dim Parm0 As ADODB.Parameters
Dim Parm1 As ADODB.Parameters
Dim rsPscd As ADODB.Recordset
Dim vSntPscd As Variant
Dim vStrPscd As Variant
Dim ThisPscd As String
Dim vRslt As Variant

StrPscd = 1

    'get the passcode from A
Sql_QryS = "select pin_code from pin_codes where pin_code_id = " &
ThisPnCdId
If GetRcrdStS(vSntPscd, 1) Then      'This gets a recordset & stores it in
vSntPscd

        'now store it in CRS

    ThisPscd = Trim(vSntPscd(0, 0))
    Set cmdStrPscd = New ADODB.Command
    With cmdStrPscd
        .ActiveConnection = cnC
        .CommandType = adCmdStoredProc
        .CommandText = "ispinvalid"
        .CommandTimeout = 15
    End With
    cmdStrPscd(0) = ThisPscd    <***  [Informix  ODBC Driver] "A syntax
error has occurred"
    cmdStrPscd(1) = 2   'operator id for migration

    Set vStrPscd = cmdStrPscd.Execute

    If vStrPscd.Fields(0) = 0 Then
        If vStrPscd.Fields(1) = 1 Then
        Else

at the cmdStrPscd(0) = ThisPscd  I get the message "A syntax error has
occurred".

This is my first experience with stored procedures so my apologies for the
probably obvious error.

Thanks for your help in advance
John



Sat, 31 Aug 2002 03:00:00 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. ADO cursor types with OLE DB Informix 7.2

2. How should I call Personal Oracle 7.2 stored procedure (or function)

3. Getting Oracle 7.2 stored procedure error messages in VB4

4. System Calls in stored procedures SE 7.2

5. Informix SE 7.2 and PHP3/ODBC

6. Informix 7.2 ODBC problem

7. Informix 7.2 & ODBC

8. ODBC to use MS Access as frontend for Informix 7.2

9. Oracle Forms 5.0 OCA/ODBC Informix 7.2

10. Informix OWS 7.2 and ODBC

11. Informix Connect 7.2 and ODBC?


 
Powered by phpBB® Forum Software