May 01, 2024, 09:23:19 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Memo type

Started by JoaoAfonso, January 18, 2008, 05:34:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoaoAfonso

Hail.
I am trying to update a field in my database that is greater than 256 characters. In my access db I've choose memo type, I have sure I use an istring (check it right before use the SQL UPDATE command), but when I open my db with access to check it, its truncate. Any hint?

Thanks in advance.
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

Ionic Wind Support Team


Quote
dbBindParameter

INT = dbBindParameter(hstmt as INT,param as INT,variable as ANYTYPE,opt cbSize as INT)

Description
Binds a variable to be used as a parameter in a prepared SQL statement.

Parameters
hstmt - A statement handle returned by dbPrepareSQL.
param - The ones based parameter number to bind.
variable - The variable to bind as a parameter.
cbSize - For string and character types.


You need to specify the size of the string when you bind the parameter in the update/insert statement.

Paul.
Ionic Wind Support Team

JoaoAfonso

*nods* That little aspect already "saved my life" some days ago, but I was able to figure it out myself alone right before posting here, because I read help file :) Anyway, I believe I do not bind parameters when updating database.

hstmt_update = dbExecSQL(pdb,texto)
dbFreeSQL(hstmt_update)
hstmt_update = NULL


And texto is my ISTRING... I was able to do it, though. Perhaps I was distracted, but when I wrote an ISTRING to my DB and opened the DB with access, the ISTRING was truncated, but if I called that cell from my program, the ISTRING was not truncated... So perhaps there were no mistake since the begining. It is strange anyway that DB didn't show it all (I was trying with an ISTRING of like 500 "m" characters to test it and was truncated. Now that I check a different ISTRING, a normal text phrase with more than 300 chars, it shows correctly...).

Now it is working as supposedly. The code wrote here is a sub called dbUpdate(texto:string). From my main code I then can send ISTRINGS to dbUpdate to fields with memo type.
dbUpdate("UPDATE PC SET describe='"+pc.describe+"' WHERE nome='"+socktablename[s]+"'")
In this piece of code describe is a memo type column from my DB, and pc.describe an ISTRING. All went well.
Thank you
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900