Displaying MS SQL Server 7.0 Error Messages

When migrating my database from SQL Anywhere 5.0 ODBC to MS SQL Server 7.0
ODBC, my PB code no longer displays database errors correctly:

messagebox("Update Error", "An error occured while loading " + as_error + "
table. All records may not have saved.~n~n" &
    + "SqlCode: " + string(sqlca.sqlcode) + "~n~n" + "SqlErrText: " +
string(sqlca.sqlerrtext) )

Always displays SqlCode of 0 and blank SqlErrText.

What is the proper way display the SQL Server 7.0 database errors?

Thanks,
Dale



0
Dale
9/7/2000 12:32:55 PM
sybase.powerbuilder.database 9855 articles. 1 followers. Follow

4 Replies
605 Views

Similar Articles

[PageSpeed] 17

I was really hoping to get some kind of response to this question.  Please
help if you have the time.

Thanks,
Dale

"Dale Roberts" <droberts@iquest.net> wrote in message
news:DQbOtfMGAHA.201@forums.sybase.com...
> When migrating my database from SQL Anywhere 5.0 ODBC to MS SQL Server 7.0
> ODBC, my PB code no longer displays database errors correctly:
>
> messagebox("Update Error", "An error occured while loading " + as_error +
"
> table. All records may not have saved.~n~n" &
>     + "SqlCode: " + string(sqlca.sqlcode) + "~n~n" + "SqlErrText: " +
> string(sqlca.sqlerrtext) )
>
> Always displays SqlCode of 0 and blank SqlErrText.
>
> What is the proper way display the SQL Server 7.0 database errors?
>
> Thanks,
> Dale
>
>
>


0
Dale
9/9/2000 5:27:42 AM
This code is correct for embedded SQL, but if you are trapping errors
in datastores, that this is not the way to do it (but it never has
been the way to do it...).  To capture datastore/datawindow errors you
need to put code in the dbError event; sqlerrtext, sqldbcode, etc. are
arguments to that event on those controls.

Jim O'Neil
Sybase Technical Support

On Sat, 9 Sep 2000 00:27:42 -0500, "Dale Roberts"
<droberts@iquest.net> wrote:

>I was really hoping to get some kind of response to this question.  Please
>help if you have the time.
>
>Thanks,
>Dale
>
>"Dale Roberts" <droberts@iquest.net> wrote in message
>news:DQbOtfMGAHA.201@forums.sybase.com...
>> When migrating my database from SQL Anywhere 5.0 ODBC to MS SQL Server 7.0
>> ODBC, my PB code no longer displays database errors correctly:
>>
>> messagebox("Update Error", "An error occured while loading " + as_error +
>"
>> table. All records may not have saved.~n~n" &
>>     + "SqlCode: " + string(sqlca.sqlcode) + "~n~n" + "SqlErrText: " +
>> string(sqlca.sqlerrtext) )
>>
>> Always displays SqlCode of 0 and blank SqlErrText.
>>
>> What is the proper way display the SQL Server 7.0 database errors?
>>
>> Thanks,
>> Dale
>>
>>
>>
>
>

0
joneil
9/9/2000 5:19:14 PM
If you perform a ROLLBACK immediately prior to this then sqlca.sqlcode will
be 0 and sqlerrtext will be "". Just a Thought.

Gregory A. Rusak
Electric Edge Systems Group Inc.
www.electricedgesystems.com

Dale Roberts wrote in message ...
>When migrating my database from SQL Anywhere 5.0 ODBC to MS SQL Server 7.0
>ODBC, my PB code no longer displays database errors correctly:
>
>messagebox("Update Error", "An error occured while loading " + as_error + "
>table. All records may not have saved.~n~n" &
>    + "SqlCode: " + string(sqlca.sqlcode) + "~n~n" + "SqlErrText: " +
>string(sqlca.sqlerrtext) )
>
>Always displays SqlCode of 0 and blank SqlErrText.
>
>What is the proper way display the SQL Server 7.0 database errors?
>
>Thanks,
>Dale
>
>
>


0
Gregory
9/14/2000 8:33:44 PM
The code you listed should work with embedded SQL but will not work
for datawindow database errors (see DBError event).

Be sure the error display occurs immediately after the database error
occurs (i.e. before you do any other database operations.)

On Thu, 7 Sep 2000 07:32:55 -0500, "Dale Roberts"
<droberts@iquest.net> wrote:

>When migrating my database from SQL Anywhere 5.0 ODBC to MS SQL Server 7.0
>ODBC, my PB code no longer displays database errors correctly:
>
>messagebox("Update Error", "An error occured while loading " + as_error + "
>table. All records may not have saved.~n~n" &
>    + "SqlCode: " + string(sqlca.sqlcode) + "~n~n" + "SqlErrText: " +
>string(sqlca.sqlerrtext) )
>
>Always displays SqlCode of 0 and blank SqlErrText.
>
>What is the proper way display the SQL Server 7.0 database errors?
>
>Thanks,
>Dale
>
>
>

0
NOSPAM_matthewc
9/15/2000 5:41:59 PM
Reply:

Similar Artilces:

Porting Ms Sql Server 6.5 database to Ms Sql Server 7.0
Hi, We have developed a product using PowerBuilder7.0, Ms Sql Server 6.5 and connecting them using powerbuilder native driver. Now we are thinking of porting Ms Sql Server 6.5 database to Ms Sql Server 7.0.As we feel, we could achive new features of Sql server 7.0.e.g row level locking. Actually i want to know, what things i have to do.e.g what sort of connection i have to use? what new features i will able to use?.will Stored procedures work properly. Is there anyting i have to chang in my application(at front end)e.g datawindows or any embeded sql, external functions. Should i po...

Porting Ms Sql Server 6.5 Database to Ms Sql Server 7.0
Hi, We have developed a product using PowerBuilder7.0, Ms Sql Server 6.5 and connecting them using powerbuilder native driver. Now we are thinking of porting Ms Sql Server 6.5 database to Ms Sql Server 7.0.As we feel, we could achive new features of Sql server 7.0.e.g row level locking. Actually i want to know, what things i have to do.e.g what sort of connection i have to use? what new features i will able to use?.will Stored procedures work properly. Is there anyting i have to chang in my application(at front end)e.g datawindows or any embeded sql, external functions. Should i po...

Pipeline Error using MS SQL Server 7.0
Whe I use the pipeline to copy a table from one MS SQL Server 7.0 database to another, I get the following error: Database error 999 SQLSTATE 07001 [Microsoft] ODBC SQL server Driver] COUNT field incorrect I am connecting to these database with ODBC and NOT any "native" drivers. Powerbuilder 6.51 Microsoft SQL Server 7.0 service pack 1 Any ideas? Thanks, Andy just a guess, but do you have a column in your table named [count] ? SQL Server allows keywords to be used as column/table names as long you provide the {} brackets around it. If you are using ODBC ...

PB7, MS SQL 7.0, Linked server (distributed transaction) error messages
Okay, I know a lot of questions about PB7.0 and SQL 7.0 have been posted, but I couldn't find one quite like this yet. I am inserting rows into one table on a SQL 7.0 server. I am also wanting to insert rows into another table on a SQL 6.5 server via a distributed transaction on the 7.0 server. I ran into an issue when a row already exists. If I try to violate the primary key on the 6.5 server, I get a 'Command Aborted' message, but no specifics or appropriate dbcode. If I execute the same statement via MS's ISQL interface, I get the appropriate 'attempt to in...

ODBC Error: MS SQL Server 7.0 + PB 6.0 +WINNT 4.0
Hi, I have installed SQL Server 7.0 Standard Ed. on Windows NT 4.0 with Service Pack 4. Then I installed Power Builder 6.0 Enterprise Ed. on the same server machine NT 4.0 + SQL Server 7.0 + PB 6.0 ( no patches for any thing installed) After defining an ODBC DSN and Profile in PB 6.0, when i try to connect from within Profile setup, it connects to the SQL Server 7.0 Database. But when i click on the Tables or Database icons on the toolbar to open the DB or tables, I get an error message like SQLSTATE =S1003 [MICROSOFT] [ODBC DRIVER MANAGER] Program Type Out of Range on the...

Powerbuilder 5.0/7.0 and MS SQL 7.0 Performance issues
We recently converted our app from Powerbuilder 5.0 to PB 7.0 -- the app in PB 7.0 definitely runs slower on the client PC's than it did in PB 5.0. Now we are migrating the database from MS SQL 6.5 to 7.0 SP2. We successfully converted the databases in a testing environment, but now the app runs terribly slow! I don't think it's a hardware issue -- the test box is a Compaq 8500 quad Xeon 500 w/1GB Ram. We experimented running the app as a PB 5.0 app against MS SQL 7.0 and the problem is the same. When we execute SQL directly against the DB outside of PB, we see no perf...

PowerBuilder 7.0 & SQL Server 7.0
Hi: I've develop an application that connect to and MS SQL SERVER 7.0 database via ODBC. When i make the .exe file and run it in Win95 or Windows NT Workstation it works fine, but when i run it in a Win98 client the following error apears. SQLSTATE=22005 - "Invalid character value for cast specification." Any clues about this. The exe was build in PowerBuilder 7.0 over a Windows NT Workstation 4.0 Thanks in advance. Jorge, Try adding to the dbparm - CallEscape='No'. Here is an example: SQLCA.DBParm = "Connectstring='DSN=<your ...

Connect MS-SQL 7.0 in PowerBuilder 7.0
In PowerBuilder 6.5, I can connect MS-SQL 6.5 directly not using ODBC, but in PowerBuilder 7.0, how can I connect MS-SQL 7.0 directly ? Please post to the powersoft.public.powerbuilder newsgroups This is dedicated to PB issues when used within Jaguar Masun wrote: > In PowerBuilder 6.5, I can connect MS-SQL 6.5 directly not using ODBC, but > in PowerBuilder 7.0, how can I connect MS-SQL 7.0 directly ? ...

PowerBuilder 7.0 & SQL Server 7.0
Hi: I've develop an application that connect to and MS SQL SERVER 7.0 database via ODBC. When i make the .exe file and run it in Win95 or Windows NT Workstation it works fine, but when i run it in a Win98 client the following error apears. SQLSTATE=22005 - "Invalid character value for cast specification." Any clues about this. The exe was build in PowerBuilder 7.0 over a Windows NT Workstation 4.0 Thanks in advance. Jorge, Try adding to the dbparm - CallEscape='No'. Here is an example: SQLCA.DBParm = "Connectstring='DSN=<your ...

PB 7.0.2 and MS SQL Server 7.0
Hello everyone, I am running PB 7.0.2 (Build 8046) and I am trying to connect to MS SQL Server 7.0 database. I can connect to the database via ODBC with no problems, but when I attempt to use the MS SQL Client Software 7.0, I get an error "Could not connect to database." Is SQL Client Software v7.0 even supported with PB 7x or do I have to go to 6.0 of SQL Client? -- Thanks, Daryl L. Avery Development Technologies Consultant Software Spectrum, Inc. E-mail: Daryl.Avery@SoftwareSpectrum.com Website: SoftwareSpectrum.com Voice: (972) 864-5114 Fax: (972) 864-3292 ...

PB 7.0 and MS-SQL Server 7.0 login problem
I am having a problem connecting my app to the MS SQL-Server database. I'm sure it's something obvious that I'm missing. From my computer, it connects just finewith no login box. When I try to connect from a different computer, a login window pops up with "Admin" as the log in name. The database should be using a trusted connection from a computer within the domain. The user on the computer is successfully logged into the (NT 4) domain. Any ideas what I am failing to do? Hi, You must provide a valid login id on the other PC you specified and this login must ...

Ms Sql Server 7.0 y PBuilder 7.0.1
Hi Here's my urgent problem: Environment: PB7.01 and Ms SqlServer 7.0 on WinNT 4.0 My problem is create a datawindows of a stored procedure my message error : data convertion result in overflow Some body helpme please My Stored Procedure is /*********************************************************************/ drop procedure prueba go create procedure prueba ( @as_codigo char(02) ) as select c_c_codigo, c_c_nombre from employee where c_c_codigo = @as_codigo go grant execute on prueba to public /****************************************************************...

Problem with PB 7.0 And MS SQL Server 7.0 ODBC
I am having some problem using PowerBuilder 7.0 with MS SQL Server 7.0 and ODBC. Arguments to datawindows and nested SQL doesn't seem the work properly. The following is some lines from the ODBC trace-file: SELECT report.reportkey, report.reporttype, report.reportname FROM report WHERE exists (SELECT reportparam.reportkey FROM reportparam WHERE ( reportparam.reportkey = report.reportkey ) AND reportparam.paramtype = ? )) ORDER BY report.reportname VCHAR Length=4 ID=:as_paramtype *test* (10 MilliSeconds) Error 999 (rc -1) : SQLSTATE ...

PB 7.0 Client Cursor and MS SQL Server 7.0
We are in the process of migrating from MS SQL 6.5 to MS SQL 7.0 and are running with PB 7.0 build 5031. Our PB application uses a cursor which works fine with MS SQL 6.5 but we are getting the following error with MS SQL 7.0 when we open the cursor: SQLCODE = -1 SQLDBCODE = 999 SQLERRTEXT= "34000[Microsoft][ODBC SQL Server Driver] Invalid cursor name" Is there a different database connection setting, different way to set up transaction object, different setting on ODBC connection, or something else that we should be doing or looking at when we go...

Web resources about - Displaying MS SQL Server 7.0 Error Messages - sybase.powerbuilder.database

List of birds displaying homosexual behavior - Wikipedia, the free encyclopedia
This list includes birds for which there is documented evidence of homosexual or transgender behavior of one or more of the following kinds: ...

Facebook Displaying Page Insights On Page Admins’ Personal Pages?
Some Facebook page administrators are seeing modules on their personal pages displaying page insights ad, campaign , and like totals for pages ...

Facebook Displaying Unread Messages from Pages in a New Updates Module
Facebook is displaying a new “Updates” sidebar module which shows some users unread messages sent to them by Pages. Users will see the Updates ...

Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air CNN Live - YouTube
Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air Lemon held up a Confederate flag first before holding up the sign. He asked, ...

Hazelwood coal mine fire: Morwell residents displaying symptoms similar to cigarette smokers, expert ...
An expert says some locals near Victoria's Hazelwood mine fire have symptoms similar to cigarette smokers.

Police accused of displaying fake G20 weapons
Toronto's top police officer misled the public by displaying fake weapons used in a medieval-themed role-playing game to help justify their actions ...

Displaying calorie labels at fast-food restaurants doesn't appear to work: study
While the high calorie counts of artery-clogging fast foods are often printed right in front of our eyes, most people ignore them and go ahead ...

Jays' Escobar suspended three games for displaying slur
Toronto Blue Jays shortstop Yunel Escobar has been suspended three games for displaying a homophobic slur on his eye-black during a game on Saturday. ...

Google Play Store now displaying age-based ratings
We reported back in May that Google was adding age-based ratings to all apps in the Play Store as determined by the International Age Rating ...

Google begins displaying “Listen Now” ads for streaming music services (including Beats) in search results ...
... , Streaming Music Continue reading more about Apps , Google , and Spotify at 9to5Mac . What do you think? Discuss "Google begins displaying ...

Resources last updated: 1/19/2016 11:17:39 PM