Jump to content

Com obj. ADODB connection.


jokke
 Share

Recommended Posts

Hiya!

Working with a mysql odbc object, where wondering if anyone know how i should get recaffected (last row affected) when i have done a execution.

As of now i use a simple workaround:

ID = rownum
Insertion -->"INSERT INTO `TableX` (id,userid) VALUES (NULL,'jokke');"
Retrieve <---"SELECT `id` FROM `TableX` WHERE `userid` LIKE 'jokke' ORDER BY `id` DESC LIMIT 0 , 1;"

Iwe used this site as a referance: http://www.w3schools.com/ADO/ev_conn_execute.asp for the object properties.

Edited by jokke
UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Hiya!

Working with a mysql odbc object, where wondering if anyone know how i should get recaffected (last row affected) when i have done a execution.

As of now i use a simple workaround:

ID = rownum
Insertion -->"INSERT INTO `TableX` (id,userid) VALUES (NULL,'jokke');"
Retrieve <---"SELECT `id` FROM `TableX` WHERE `userid` LIKE 'jokke' ORDER BY `id` DESC LIMIT 0 , 1;"

Iwe used this site as a referance: http://www.w3schools.com/ADO/ev_conn_execute.asp for the object properties.

That appears to be a parameter passed by an event, not a property you can read. Look in the help file under OBJ/COM Reference, in the section titled "COM Events", and also at the ObjEvent() function.

It would look something like:

$oAdoDbEvent = ObjEvent($oAdoDb, "_AdoDbEvent_")

; ...perform $oAdoDb.Execute()

Func _AdoDbEvent_ExecuteComplete($recaffected, $objerror, $status, $objcomm, $objrs, $objconn)
    MsgBox(64, "ADODB Event", "Execute Complete: recaffected = " & $recaffected)
EndFunc

...or similar.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...