Ok,
I've done some more investigation it turns out that setting the .asstring is quoting correctly, my errors where being caused by an un-quoted quote in a select statement.
So I've added a call to EncodeCString() around the passed in string.
Cheers.
Phill.
Search found 12 matches
- 01.03.2010, 15:48
- Forum: 6.6 - stable
- Topic: quote characters in queries
- Replies: 1
- Views: 268
- 01.03.2010, 14:58
- Forum: 6.6 - stable
- Topic: quote characters in queries
- Replies: 1
- Views: 268
quote characters in queries
Hi, In my app I have found that if I have a TDBEdit, that is linked to a field in a mysql table (via a TZQuery, and TZconnection). If I type a string with a single quote in it such as "test'test" the field is correctly posted to the database (and the quote is escaped on the way, checked wi...
- 16.11.2009, 15:42
- Forum: MySQL
- Topic: Problems updating Blob field
- Replies: 2
- Views: 749
- 16.11.2009, 15:13
- Forum: MySQL
- Topic: Problems updating Blob field
- Replies: 2
- Views: 749
Trying another way of doing the update : PROCEDURE TChemDataModule.SaveDatasheet(InChemicalIDNo : Cardinal; Datasheet : TStream; FileName : STRING); VAR Blob : TStream; BEGIN; WITH ZDatasheetQuery DO BEGIN; Active:=FALSE; SQL.Text:=Format('replace into %s values(:%s,:%s,:%s)', [DbTableChemDatasheet....
- 16.11.2009, 13:20
- Forum: MySQL
- Topic: Problems updating Blob field
- Replies: 2
- Views: 749
Problems updating Blob field
Hi, I'm trying to update a Blob field in one of my tables from a small word doc file that is stored in a TStream. I'm using Delphi 7, Zeos 6.6.5, and MySQL 5.0.x My update code is as follows : PROCEDURE TChemDataModule.SaveDatasheet(InChemicalIDNo : Cardinal; Datasheet : TStream; FileName : STRING);...
- 01.11.2009, 06:20
- Forum: SQLite
- Topic: Strange edit behavior
- Replies: 1
- Views: 453
Strange edit behavior
Ok, so I'm trying to write a simple game launcher and using sqllite as the backend. I have a form where I can edit the game configurations that has the following components all linked to the same DataSource, which is liked to a ZQuery and then to a ZConnection to the database. The components I have ...
- 02.03.2009, 18:24
- Forum: MySQL
- Topic: Retrieving enum types as string
- Replies: 1
- Views: 439
Retrieving enum types as string
Hi, Using Delphi 7, Zeos 6.6.0. I have a database table in MySQL 5.0.26 (linux) that has the following fields defined : iselectrical enum('Y','N') Interest enum('Y','N','U') When I try and uses FieldByName('iselectrical').AsString it always returns 'true' or 'false', whereas if i use FieldByName('In...
- 03.10.2008, 17:25
- Forum: MySQL
- Topic: Retrieving column comments
- Replies: 2
- Views: 432
- 01.10.2008, 10:06
- Forum: MySQL
- Topic: Retrieving column comments
- Replies: 2
- Views: 432
Retrieving column comments
Is there a way of retrieving the column comments from a MySQL 5 database ?
Cheers.
Phill.
Cheers.
Phill.
- 04.06.2007, 11:57
- Forum: 6.5.1 (alpha) - 6.6.x (beta)
- Topic: Weird crash in 6.6.1 beta.
- Replies: 5
- Views: 1233
- 30.05.2007, 16:34
- Forum: 6.5.1 (alpha) - 6.6.x (beta)
- Topic: Weird crash in 6.6.1 beta.
- Replies: 5
- Views: 1233
Tried that, which alas did not seem to work :( Further investigation has revealed that the open is infact working, however it was triggering the onclick event of a TDBCheck box, which was attempting to modify one of the other fields and failing. The things is the Database *SHOULD* be open in read/wr...
- 23.05.2007, 14:19
- Forum: 6.5.1 (alpha) - 6.6.x (beta)
- Topic: Weird crash in 6.6.1 beta.
- Replies: 5
- Views: 1233
Weird crash in 6.6.1 beta.
Hi, Using Zeos 6.6.1beta under Delphi 7, my database is a MySQL 5.x on a SuSE Linux server. The problem is the following code crashes with a EDatabaseError : "ZEditQuery: dataset is not in edit or insert mode". This only happens about 50% of the time, the other 50% it seems to be fine. WIT...