Re: Setting a default Text value with "Create Table" ?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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.
.



Relevant Pages

  • Re: get only filenames and not directory names under a specific path.
    ... > I'm guess maybe it's must do that when it's double quotes. ... but with two exceptions: the escape character itself ... the string delimiter can also be escaped to allow embedded single quotes, ... means that a path with a trailing backslash needs two backslashes there to avoid ...
    (perl.beginners)
  • Re: single quotes in gsub
    ... I haven't found a way to escape that single quote, ... Unlike double quotes, ... Just put the awk script in a file. ... This way, you don't have the shell's single quotes in the way, and you can ...
    (comp.lang.awk)
  • Re: [PHP] using mysql_escape_string with implode() !!
    ... I'm trying to generate the string with escape slashes before I put it ... enclosed in Single Quotes while inserting into mySQL and Single Quote ...
    (php.general)
  • Re: re-quoting (aka reconstituting a command line)
    ... contains any single quotes, ... // specials, or control characters ...
    (comp.unix.shell)
  • Re: Rather crass VB humour...
    ... Lots of good quotes regarding programming languages and related stuff at ... using rocks to sharpen sticks. ... Chair, Paradox/Delphi SIG, Cincinnati PC Users Group ...
    (comp.lang.pascal.delphi.misc)