Attempting to update database via VB 5.0 DAO 3.5 - Mailing list pgsql-interfaces

From Vince DiCiero
Subject Attempting to update database via VB 5.0 DAO 3.5
Date
Msg-id 01BE499E.26CECCA0.vdiciero@flash.net
Whole thread Raw
List pgsql-interfaces
I could use some help getting a VB app to work with PostgreSQL
I am using VB5 with DAO 3.5
ODBC Driver version 6.40.0004

The following code causes an ODBC Error
3146 ODBC call failed
Driver output:
STATEMENT ERROR: func=SQLSetPos, desc='', errnum=10, errmsg='Only
SQL_POSITION/REFRESH is supported for SQLSetPos'
this error occurs while doing a recordset update

code snipet follows:

Dim sqlUsers As String
Dim rsUsers As Recordset


    sqlUsers = "select * from Users WHERE UserName = " & "'" & sUserName &
"'"
    Set theDB = theWorkspace.OpenDatabase("", False, False, "ODBC;DSN=" +
        sDatabasePath + ";UID=postgres;PWD=postgres;")
    On Error GoTo Connect_Error
    Set rsUsers = theDB.OpenRecordset(sqlUsers, dbOpenDynamic, 0,
bOptimistic)

    If Not rsUsers.EOF Then
        If rsUsers!Password = sPassword Then
            dbError = 0
            dbErrorMsg = ""
            rsUsers.Edit
            rsUsers!SignedON = 1
            Connect = True
            rsUsers!LastAccess = Now
            If Len(NewPassword) Then
                rsUsers!Password = NewPassword
            End If
causes error  --> rsUsers.Update
    ........

ODBC driver output
conn=40173688, SQLDriverConnect(
in)='DSN=PostgreSQL;UID=postgres;PWD=postgres;', fDriverCompletion=1
DSN info:
DSN='PostgreSQL',server='Littlemac',port='5432',dbase='filex',user='post
gres',passwd='postgres'

         readonly='0',protocol='6.4',showoid='0',fakeoidindex='0',showsy
stable='0'
          conn_settings=''
          translation_dll='',translation_option=''
Global Options: Version='06.40.0004', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=4094
                disable_optimizer=1, ksqo=1, unique_index=0,
use_declarefetch=0
                text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1
                extra_systable_prefixes='dd_;', conn_settings=''
conn=40173688, query=' '
conn=40173688, query='set DateStyle to 'ISO''
conn=40173688, query='set geqo to 'OFF''
conn=40173688, query='set ksqo to 'ON''
conn=40173688, query='select oid from pg_type where typname='lo''
    [ fetched 0 rows ]
conn=40173688,
SQLDriverConnect(out)='DSN=PostgreSQL;DATABASE=filex;SERVER=Littlemac;PO
RT=5432;UID=postgres;PWD=postgres;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=0
;SHOWOIDCOLUMN=0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS='
conn=40173688, query='select * from Users WHERE UserName = 'Admin''
    [ fetched 1 rows ]
STATEMENT ERROR: func=SQLSetPos, desc='', errnum=10, errmsg='Only
SQL_POSITION/REFRESH is supported for SQLSetPos'

                --------------------------------------------------------
----
                 hdbc=40173688, stmt=40188216, result=40254208
                 manual_result=0, prepare=0, internal=0
                 bindings=40260260, bindings_allocated=7
                 parameters=0, parameters_allocated=0
                 statement_type=0, statement='select * from Users WHERE
UserName = 'Admin''
                 stmt_with_params='select * from Users WHERE UserName =
'Admin''
                 data_at_exec=-1, current_exec_param=-1, put_data=0
                 currTuple=0, current_col=-1, lobj_fd=-1
                 maxRows=0, rowset_size=100, keyset_size=0, cursor_type=3,
scroll_concurrency=3
                 cursor_name='SQL_CUR02653938'
                 ----------------QResult Info
-------------------------------
                 fields=41222468, manual_tuples=0, backend_tuples=40254492,
tupleField=40254492, conn=40173688
                 fetch_count=0, fcount=1, num_fields=7, cursor='(null)'
                 message='(null)', command='SELECT', notice='(null)'
                 status=8, inTuples=0
CONN ERROR: func=SQLSetPos, desc='', errnum=0, errmsg=''
            ------------------------------------------------------------
            henv=41226200, conn=40173688, status=1, num_stmts=16
            sock=41222276, stmts=41222316, lobj_type=-999
            ---------------- Socket Info -------------------------------
            socket=81, reverse=0, errornumber=0, errormsg='(null)'
            buffer_in=40180016, buffer_out=40184116
            buffer_filled_in=261, buffer_filled_out=0, buffer_read_in=260
conn=40173688, SQLDisconnect

TIA for any assistance

Vince DiCiero

pgsql-interfaces by date:

Previous
From: James Thompson
Date:
Subject: Re: [INTERFACES] EXEC SQL CONNECT
Next
From: "Hiroshi Inoue"
Date:
Subject: Use Declare/Fetch option