Article View: borland.public.cppbuilder.database.ado
Article #4553error creating table using microsoft odbc text driver
From: Phua Ooi Ewe
Date: Wed, 28 Nov 2001 04:52
Date: Wed, 28 Nov 2001 04:52
77 lines
3371 bytes
3371 bytes
I am trying to create a table(dstTable) using batCopy mode with TBatchMove
component.
void TImportForm::Transfer( TTable *srcTable, TTable *dstTable, TBatchMode
mode )
{
BatchMove->Source = srcTable;
BatchMove->Destination = dstTable;
BatchMove->Mode = mode;
BatchMove->KeyViolTableName = Format( "Key_%s.db", OPENARRAY(TVarRec,
(srcTable->TableName)) );
BatchMove->ProblemTableName = Format( "Prob_%s.db", OPENARRAY(TVarRec,
(srcTable->TableName)) );
BatchMove->ChangedTableName = Format( "Changed_%s.db",
OPENARRAY(TVarRec, (srcTable->TableName)) );
BatchMove->Execute();
}
The operation will fail with error
"Cannot modify the design of table 'MY_TABLE'. It is in a read-only
database."
The ReadOnly property of the TDatabase component i am using is always set to
false.
The following are extracted from trace file provided by ODBC Data Source
Administrator. (DSMProj is my program name)
DSMProj 182-16f EXIT SQLDriverConnectW with return code 1
(SQL_SUCCESS_WITH_INFO)
HDBC 032D16F8
HWND 00000000
WCHAR * 0x1F7D8B70 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x1F7D8B70
SWORD 8
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
DIAG [01S00] [Microsoft][ODBC Text Driver]Invalid connection string
attribute DATABASE (8)
DIAG [01S00] [Microsoft][ODBC Text Driver]Invalid connection string
attribute DATABASE (8)
DIAG [01S00] [Microsoft][ODBC Text Driver]Invalid connection string
attribute DATABASE (8)
DIAG [01S00] [Microsoft][ODBC Text Driver]Invalid connection string
attribute DATABASE (8)
...
...
...
DSMProj 182-16f ENTER SQLGetInfoW
HDBC 032D16F8
UWORD 25 <SQL_DATA_SOURCE_READ_ONLY>
PTR 0x032D1E28
SWORD 512
SWORD * 0x0012F446
...
...
...
DSMProj 182-5e EXIT SQLExecDirect with return code -1 (SQL_ERROR)
HSTMT 032D2148
UCHAR * 0x01AED96C [ -3] " CREATE TABLE `MY_TABLE`
`RETURN_TYPE` CHAR( 1),`DESCRIPTION` CHAR( 60) ) \ 0"
SDWORD -3
DIAG [42000] [Microsoft][ODBC Text Driver] Cannot modify the design of
table 'MY_TABLE'. It is in a read-only database. (-1809)
--
Phua Ooi Ewe
Software Engineer
Knowledge Engineering Pte Ltd
Technical Details
Message-ID:
<3c046d9c_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,b86c7b0687ee57ac,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-11-27 21:01:01 PST From: "Phua Ooi Ewe" <ooiewe@kesoft.com.sg> Newsgroups: borland.public.cppbuilder.database.ado Subject: error creating table using microsoft odbc text driver Date: Wed, 28 Nov 2001 12:52:21 +0800 Lines: 79 Organization: Knowledge Engineering Pte. Ltd. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: 210.24.189.198 Message-ID: <3c046d9c_1@dnews> X-Trace: dnews 1006923164 210.24.189.198 (27 Nov 2001 20:52:44 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews