HP3000-L Archives

August 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Keith Patterson <[log in to unmask]>
Reply To:
Keith Patterson <[log in to unmask]>
Date:
Sun, 15 Aug 1999 20:58:23 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (103 lines)
When I use an ADODB.Recordset, with hard coded options, to open a recordset, it
works fine.  Like:

=======================
dim rs as ADODB.Recordset
dim oConn as ADODB.Connection

set rs = new ADODB.Recordset
rs.Open "Select * From PP_TAXP_DETL WHERE Taxpayer = ?", oConn,
adOpenForwardOnly,,adCmdText
=======================

However, when I use an ADODB.Command object to open the recordset, as in:

=======================
dim oCommand as ADODB.Command
dim rs as ADODB.Recordset

with oCommand
        .CommandText = "Select * From PP_TAXP_DETL WHERE Taxpayer = ?"
        .ActiveConnection = oConn    'previously defined connection
        .CommandType = adCmdText
end with

rs.Open oCommand, ,lCursorType, lLockType,adCmdText
=======================

I get the following messages in the SQL log:

VB6             fff8c237:fff76233       ENTER SQLPrepareW
        HSTMT               0x0eb40ca8
        WCHAR *             0x0ef42480 [      45] "SELECT * FROM PP_TAXP_DETL
WHERE Taxpayer = ?"
        SDWORD                    45

VB6             fff8c237:fff76233       EXIT  SQLPrepareW  with return code 0
(SQL_SUCCESS)
        HSTMT               0x0eb40ca8
        WCHAR *             0x0ef42480 [      45] "SELECT * FROM PP_TAXP_DETL
WHERE Taxpayer = ?"
        SDWORD                    45

VB6             fff9af87:fffb3e03       ENTER SQLNumParams
        HSTMT               0x0eb40ca8
        SWORD *             0x0ef41c88

VB6             fff9af87:fffb3e03       EXIT  SQLNumParams  with return code 0
(SQL_SUCCESS)
        HSTMT               0x0eb40ca8
        SWORD *             0x0ef41c88 (1)

** Query is successfully prepared (I think), and recognized to contain 1
parameter

VB6             fff8c237:fff76233       ENTER SQLExecDirectW
        HSTMT               0x0eb40ca8
        WCHAR *             0x1f64e4c8 [      73] "SELECT INVALID SELECT
STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE\ 0"
        SDWORD                    73

VB6             fff8c237:fff76233       EXIT  SQLExecDirectW  with return code
-1 (SQL_ERROR)
        HSTMT               0x0eb40ca8
        WCHAR *             0x1f64e4c8 [      73] "SELECT INVALID SELECT
STATEMENT TO FORCE ODBC DRIVER TO UNPREPARED STATE\ 0"
        SDWORD                    73

DIAG [42000] [MiniSoft] [3kodbc.dll] Syntax error in SELECT statement. (0)

**  I haven't the faintest idea WHAT this is telling me

 =======================================================================

Is anyone using the ADODB Command object with the Minisoft ODBC32 driver??

If so, could you please let me know what I'm doing wrong here??

I have also noticed that I get the error "Minisoft(3kodbc.dll) Syntax error in
table list" if I set Command.CommandText = to a query that contains a join.
This behavior becomes apparent when I try to do Refresh on the Parameter
collection prior to filling it out.  It appears that the Command object was
unable to parse the query and therefore did not instantiate the Parameter
collection. ("Object variable or with block variable not set")

Is anyone using the ADODB Recordset object with the Minisoft ODBC32 driver??

If so, have you experienced any problems similar to this??

Some conjecture on my part:
I'm used to working in SQL Server which will cast parameters as the correct
datatype based on the field in the database that I'm going after.  Will ODBC32
do this??  Do I have to completely (including tics as needed for text fields)
build the SQL statement before making the call??  Could this be why it works on
the recordset and not from the Command object??

Any and all input will be sincerely appreciated,

Keith



cc: [log in to unmask]

ATOM RSS1 RSS2