Re: Setting a default Text value with "Create Table" ?
- From: "Mary Chipman [MSFT]" <mchip@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 12 Oct 2005 16:14:00 -0400
I'm not a C++ programmer so I'm not familiar with how you escape
quotes, but what I've found useful in other programming languages is
to write the string value of the variable to a console window or
debugger pane, then copy and paste it into an empty Access query
window (use the SQL option on the toolbar) to see if it flies.
--Mary
On Tue, 11 Oct 2005 11:02:25 -0400, anastasiA <nones@xxxxxxxxxxx>
wrote:
>Hello.
>
>I'm am creating a table via ODBC to MSAccess in C++ and I have a problem
>with the CREATE RABLE syntax. I am trying to set a default text value
>to a specific field. Somthing like:
>
>char *query = "CREATE TABLE foo(id int, bar text(20) DEFAULT
>'myDefault')";
>
>or
>
>char *query = "CREATE TABLE foo(id int, bar text(20) NOT NULL DEFAULT
>'myDefault')";
>
>Without a default value, it works fine but I believe the problem
>lies in correct "quotes" in my char string. The example above has
>single quotes but I've tried escaped single quotes like: \'myDefault\'
>double-escaped single quotes like \''myDefault\'' but nothing works.
>
>IOr maybe there's another problem that I might not see ? Does it support
>a default text value ?
>
>Thank you.
.
- References:
- Setting a default Text value with "Create Table" ?
- From: anastasiA
- Setting a default Text value with "Create Table" ?
- Prev by Date: Synchronise Two different ODBC sources
- Next by Date: Re: how can i connect the sql server2000 in c++
- Previous by thread: Setting a default Text value with "Create Table" ?
- Next by thread: Re: Setting a default Text value with "Create Table" ?
- Index(es):
Relevant Pages
|