Professional Web Applications Themes

nsqlprep and C++.NET compiler - Microsoft SQL / MS SQL Server

I have embedded SQL statements within a C source module. When I compile the output of the nsqlprep utility, with Visual Studio 6.0 (and Visual Studio 6.0 libraries), the compilation completes successfully. However, when I precompile this same module, using nsqlprep, with the Visual Studio.NET (and Visual Studio.NET libraries), the compilation fails with syntax errors. Has anyone encountered this problem? Thanks in advance, Doug...

  1. #1

    Default nsqlprep and C++.NET compiler

    I have embedded SQL statements within a C source module.
    When I compile the output of the nsqlprep utility, with
    Visual Studio 6.0 (and Visual Studio 6.0 libraries), the
    compilation completes successfully. However, when I
    precompile this same module, using nsqlprep, with the
    Visual Studio.NET (and Visual Studio.NET libraries), the
    compilation fails with syntax errors. Has anyone
    encountered this problem?

    Thanks in advance,
    Doug
    Doug Guest

  2. #2

    Default Re: nsqlprep and C++.NET compiler

    It would help if you would post the syntax errors that you are getting.
    Probably this is caused by the fact that Embedded SQL uses DB-Library and
    you are running in to problems with that.

    Net

    Please reply only to the newsgroups.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    You assume all risk for your use.
    Copyright © SQLDev.Net 1991-2003 All rights reserved.

    "Doug Twyman" <com> wrote in message
    news:04f101c3604d$bd63f9e0$gbl... 


    Gert Guest

  3. #3

    Default Re: nsqlprep and C++.NET compiler

    Here is a sample of the code generated by nsqlprep (with
    Visual Studio 6.0 libraries):

    else {
    if ((sqlca->sqlcode == 0) ||
    (sqlca->sqlcode == 100))

    #line 477
    /*
    EXEC SQL CLOSE CUR_0002228424_2 ;
    */
    #line 477

    #line 477
    {
    #line 477
    sqlastrt((void far *)pid, (void far *)0, (struct
    tag_sqlca far *)sqlca);
    #line 477
    sqlxcall(20, 2, 0, 0, 26, (char far *)" CLOSE
    CUR_0002228424_2 ");
    #line 477
    SQLCODE = sqlca->sqlcode;
    #line 477
    sqlastop((void far *)0L);
    #line 477
    }
    #line 478
    }


    Here is a sample of the code generated by nsqlprep (with
    Visual Studio.NET libraries):

    else {
    if ((sqlca->sqlcode == 0) ||
    (sqlca->sqlcode == 100))

    #line 477
    /*
    EXEC SQL CLOSE CUR_0002228424_2 ;
    */
    #line 477

    }

    When this code is compiled by the C++.NET compiler, I
    receive the following error:

    F7484222.sqc(478) : error C2143: syntax error :
    missing ';' before '}'

    As you can see, the code generated by nsqlprep with the VS
    6.0 libraries substitutes C code for the EXEC SQL CLOSE
    statement.
    While the code generated by nsqlprep with VS.NET libraries
    does not substitute C code for the EXEC SQL CLOSE
    statement.

    I hope this provides the needed clarification as to the
    problem I am facing.

    Thanks in advance,
    Doug Twyman 
    you are getting. 
    uses DB-Library and 
    confers no rights. 
    >
    >
    >.
    >[/ref]
    Doug Guest

  4. #4

    Default Re: nsqlprep and C++.NET compiler

    NPREPSQL.EXE did not change, the last version was the one that came with SQL
    Server 7.0 (which was the on from 6.5), so I am confused how the code that
    gets generated all of a sudden would change. I only tried the samples of
    ESQLC which comes with the product and using Visual Studio 2003 it works the
    same as using VC 6.0

    I also hope you are not investing too much in this technology, see BOL of
    SQL Server 2000.



    Warning While the ESQL/C API is still supported in Microsoft SQL Server
    2000, no future versions of SQL Server will include the files needed to do
    programming work on applications that use this API. Connections from
    existing applications written using ESQL/C will still be supported in the
    next version of SQL Server, but this support will also be dropped in a
    future release. When writing new applications, avoid using ESQL/C. When
    modifying existing applications, you are strongly encouraged to remove
    dependencies on ESQL/C. Instead of ESQL/C, you can use Microsoft ActiveX®
    Data Objects (ADO), OLE DB, or ODBC to access data in SQL Server.

    Net

    Please reply only to the newsgroups.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    You assume all risk for your use.
    Copyright © SQLDev.Net 1991-2003 All rights reserved.

    "Doug Twyman" <com> wrote in message
    news:044e01c36113$4878e020$gbl...
    Here is a sample of the code generated by nsqlprep (with
    Visual Studio 6.0 libraries):

    else {
    if ((sqlca->sqlcode == 0) ||
    (sqlca->sqlcode == 100))

    #line 477
    /*
    EXEC SQL CLOSE CUR_0002228424_2 ;
    */
    #line 477

    #line 477
    {
    #line 477
    sqlastrt((void far *)pid, (void far *)0, (struct
    tag_sqlca far *)sqlca);
    #line 477
    sqlxcall(20, 2, 0, 0, 26, (char far *)" CLOSE
    CUR_0002228424_2 ");
    #line 477
    SQLCODE = sqlca->sqlcode;
    #line 477
    sqlastop((void far *)0L);
    #line 477
    }
    #line 478
    }


    Here is a sample of the code generated by nsqlprep (with
    Visual Studio.NET libraries):

    else {
    if ((sqlca->sqlcode == 0) ||
    (sqlca->sqlcode == 100))

    #line 477
    /*
    EXEC SQL CLOSE CUR_0002228424_2 ;
    */
    #line 477

    }

    When this code is compiled by the C++.NET compiler, I
    receive the following error:

    F7484222.sqc(478) : error C2143: syntax error :
    missing ';' before '}'

    As you can see, the code generated by nsqlprep with the VS
    6.0 libraries substitutes C code for the EXEC SQL CLOSE
    statement.
    While the code generated by nsqlprep with VS.NET libraries
    does not substitute C code for the EXEC SQL CLOSE
    statement.

    I hope this provides the needed clarification as to the
    problem I am facing.

    Thanks in advance,
    Doug Twyman 
    you are getting. 
    uses DB-Library and 
    confers no rights. 
    >
    >
    >.
    >[/ref]


    Gert Guest

Similar Threads

  1. Re[4]: [PHP-DEV] PHP compiler
    By Simeon Koptelov in forum PHP Development
    Replies: 3
    Last Post: August 6th, 04:10 PM
  2. [PHP-DEV] PHP compiler
    By Jeremy S. Johnstone in forum PHP Development
    Replies: 5
    Last Post: August 6th, 03:50 PM
  3. Re[6]: [PHP-DEV] PHP compiler
    By Simeon Koptelov in forum PHP Development
    Replies: 0
    Last Post: August 6th, 03:44 PM
  4. Re[2]: [PHP-DEV] PHP compiler
    By Jeremy S. Johnstone in forum PHP Development
    Replies: 1
    Last Post: August 6th, 02:43 PM
  5. Replies: 0
    Last Post: July 21st, 10:49 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139