Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
Problem with SQL String Generated from Code |
Tue, Jul 24 2007 5:58 AM | Permanent Link |
Peter Thorne | Sorry it's me again.
I have been trying the following code: with qryImpEx do begin BackupName := ChangeFileExt(ExtractFileName(FileName), ''); BackupDir := ExtractFileDir(FileName); SQLString := 'BACKUP DATABASE ExtrapolateIE' + ' AS ' + engExtrapolate.QuotedSQLStr(BackupName) + ' TO ' + engExtrapolate.QuotedSQLStr(BackupDir) + ' INCLUDE CATALOG'; SQL.Clear; SQL.Add(SQLString); Prepare; ExecSQL; end To generate (for example): 'BACKUP DATABASE ExtrapolateIE AS 'TestExport' TO 'C:\Documents and Settings\Owner\Desktop' INCLUDE CATALOG' as the SQL string. This is throwing a 700 error at runtime (Expected backup name but instead found 'TestExport'). What am I doing wrong? Peter |
Tue, Jul 24 2007 6:16 AM | Permanent Link |
Peter Thorne | OK. I've kind of sussed this running the query statically. It looks like you need double quotes for the backup name and single quotes for the backup directory (seems a bit wierd?)
|
Tue, Jul 24 2007 4:12 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Peter,
<< OK. I've kind of sussed this running the query statically. It looks like you need double quotes for the backup name and single quotes for the backup directory (seems a bit wierd?) >> The backup name is considered an identifier and the backup directory is a constant. The reason for this is that the backup name must follow identifier naming rules due to the fact that it shows up in the configuration database: http://www.elevatesoft.com/edb1sql_backups_table.htm -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |