sybase4 to sybase10 
Author Message
 sybase4 to sybase10

I have an apt screen that calls an external db-lib/c function. The user is
logged in to the db thru the apt screen. There is a first connection:

dbproc1 = (DBPROCESS *)argarray[0];

Then a second and third connection:

if ((dbproc2 = dbopen((LOGINREC *)argarray[1], NULL)) == NULL)
    {
        exit(ERREXIT);
    }

if ((dbproc3 = dbopen((LOGINREC *)argarray[1], NULL)) == NULL)
    {
        exit(ERREXIT);
    }

There are 3 separate sql statements, the last 2 depend on data from the
first one.

The problem is that this works under sybase4 and gives this error when
running under sybase10_0_2:

XRAISE: FATAL (S12,M4-200)
Can't continue: program error (Segmentation Violation).

The error happens when it tries to open the second connection.
Does anyone have any idea what I should be doing? argarray is an input
parameter to the function and is of type POINTER. Any help is greatly
appreciated.

Thanks.

Allyson



Sat, 18 Jul 1998 03:00:00 GMT
 sybase4 to sybase10

Quote:

>I have an apt screen that calls an external db-lib/c function. The user is
>logged in to the db thru the apt screen. There is a first connection:

>dbproc1 = (DBPROCESS *)argarray[0];

>Then a second and third connection:

>if ((dbproc2 = dbopen((LOGINREC *)argarray[1], NULL)) == NULL)
>    {
>        exit(ERREXIT);
>    }

>if ((dbproc3 = dbopen((LOGINREC *)argarray[1], NULL)) == NULL)

                                           ^^^
         This should be argarray[2], I imagine.        

Quote:
>    {
>        exit(ERREXIT);
>    }

>There are 3 separate sql statements, the last 2 depend on data from the
>first one.

>The problem is that this works under sybase4 and gives this error when
>running under sybase10_0_2:

>XRAISE: FATAL (S12,M4-200)
>Can't continue: program error (Segmentation Violation).

>The error happens when it tries to open the second connection.
>Does anyone have any idea what I should be doing? argarray is an input
>parameter to the function and is of type POINTER. Any help is greatly
>appreciated.

>Thanks.

>Allyson

  Beyond the typo, you will have had to allocate memory before calling
  dbopen:
     argarray[0] = (POINTER)dblogin();
     argarray[1] = (POINTER)dblogin();
     argarray[2] = (POINTER)dblogin();
     //  check that argarray[0..2] are != 0

  I can't tell from the example whether or not you did that.

--
Stan Sulsky                              

          97 Madbury Rd.            |   (603) 868-2270 - voice
          Durham, NH 03824   USA    |   (603) 868-1352 - fax



Sat, 18 Jul 1998 03:00:00 GMT
 sybase4 to sybase10


Quote:
> I have an apt screen that calls an external db-lib/c function. The
> user is logged in to the db thru the apt screen. There is a first
> connection:

> dbproc1 = (DBPROCESS *)argarray[0];

> Then a second and third connection:

> if ((dbproc2 = dbopen((LOGINREC *)argarray[1], NULL)) == NULL)
> {
> exit(ERREXIT);
> }

> if ((dbproc3 = dbopen((LOGINREC *)argarray[1], NULL)) == NULL)
> {
> exit(ERREXIT);
> }

> There are 3 separate sql statements, the last 2 depend on data from
> the first one.

> The problem is that this works under sybase4 and gives this error when
> running under sybase10_0_2:

> XRAISE: FATAL (S12,M4-200)
> Can't continue: program error (Segmentation Violation).

> The error happens when it tries to open the second connection.
> Does anyone have any idea what I should be doing? argarray is an input
> parameter to the function and is of type POINTER. Any help is greatly
> appreciated.

> Thanks.

> Allyson

Is argarray and array of LOGINREC pointers or DBPROCESS pointers.
If the former then
    dbproc1 = (DBPROCESS *)argarray[0];
makes no sense.
when did argarray get initialized? From calls to dblogin() ?
You only need one login handle if you are simply opening multiple
connections to the same database (with the same user/password).
The code should read:

    LOGINREC    *dbLogin;
    dbLogin = dblogin();

    dbsetlname(dbLogin, "username", DBSETUSER);
    dbsetlname(dbLogin, "password", DBSETPWD);

    if ((dbproc2 = dbopen(dbLogin, "SERVER")) == NULL)
        ...
    etc.

I suspect you didn't give us the full info, the code fragment
you displayed doesn't make a lot of sense. See the parameter
definitions for these functions in the manual.

Ray Steel



Sun, 19 Jul 1998 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Upgrade Sybase4.9.2 to System 10

2. Sybase10 Raiserror/Delphi/BDE

3. VB3-Sybase10 ODBC driver Help

4. BDE/Sybase10 -- cry for help

5. Sybase10 under NThelp plz

6. PB5.0/ Sybase10 Connectivity Problem

7. ##US-NYC-Wall Street - Project Sybase10/11/Rep DBA - $95K base plus bonus

8. US-IA SYBASE10 DBA Long Term High rates

9. Q: Error Handling in ODBC/VB/Sybase10

10. Sybase10-Sybase11 upgrade problems

11. Upgrade SQL-Server 4.2 -> Sybase10

12. Newbie - ODBC/Win95/Sybase10


 
Powered by phpBB® Forum Software