CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    2

    [ODBC] How to INSERT text record

    How can I add this text record (what includes the ' sign) to a table via ODBC (SQL Server 6.0) :
    Field Name :
    Names (varchar)
    Value: eg.
    'Laci' vagy 'Maci'

    Laszlo Sera

  2. #2
    Join Date
    Apr 1999
    Location
    Philadelphia, PA, US
    Posts
    138

    Re: [ODBC] How to INSERT text record

    1. Create ODBC Datasource and connect with your sql server database
    2. TAke an instance of CDatabase MFC Class and call Open method of CDatabase with datasource parameter
    3. Call ExecuteSQL method of CDatabase with INSERT .. INTO query



  3. #3
    Join Date
    Apr 1999
    Location
    Michigan, USA
    Posts
    115

    Re: [ODBC] How to INSERT text record

    If you are building your SQL string in code you must remember that the apostrophe ( ' ) is a delimiter
    in SQL. to use the string 'Laci' vagy 'Maci' in SQL you must replace each apostrophe with two
    apostrophes. ''Laci'' vagy ''Maci''. Note: these are two apostrophes not a quote.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured