[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-odbc
Subject:    myodbc: more Visual Basic problem
From:       Patrik Källström <darkangel () linux ! nu>
Date:       1999-02-23 1:08:10
[Download RAW message or body]

I have a similar problem and this did not help:

On Sat, 20 Feb 1999, you wrote:
>There are two conditions that ODBC Curser Manager requires from a data
>source. 1:PRIMARY KEY and 2:TIME STAMP. Your Cursor Manager has opened the
>database in read-only mode if this condition does not exist. Try a create
>statement like this.......
>	
>	create table la(someid int not null,........,TS timestamp, primary key
>(someid))
>
I have used yours table "la" and added "nr int" whare the ........ is.
Here is a part of my VB5 program and the errors i get:
-------------------------------------------------

sDAOConnect = "ODBC;DSN=" & sDSN & ";" & sConnect
    
    DBEngine.DefaultType = dbUseODBC
    Set work = CreateWorkspace("ODBC-workspace", "", "")

    work.DefaultCursorDriver = dbUseClientBatchCursor

    Set db = work.OpenConnection("", 0, False, sDAOConnect)
    
    
    Set rs = db.OpenRecordset("SELECT * FROM la", dbOpenDynaset, 0, dbOptimisticBatch)

---
    
    rs.AddNew
    rs!someid = 4
    rs!nr = 12
    rs.Update
    rs.Update dbUpdateBatch
    ^^^^^^^^^^^^^^^^^^^^^^^ here i get:
    Run-time error '3146'
    ODBC--call faild.
    
---

    rs.Edit
    rs!nr = 13
    ^^^^^^^^^^^ here i get:
        Run-time error '3219'
        invalid operation.

    rs.Update
    rs.Update dbUpdateBatch

-----------------------------------------------

I have tryed to solve this problem for a  long time now and i have tryed to
find any sample vb5 program using mysql but i can not find any.

Patrik
-----------------------------------------------------------
Send a mail to mdomo@tcx.se with
unsubscribe myodbc your@subscription.address
in the body of the message to unsubscribe from this list.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic