The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 error trapping and adodb connection
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 11/24/2003 :  04:57:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I am trying to error trap and adodb connection such that my C code doesn't crash out.

eg

SQLString = "select * table";
ocrs = CreateObject("ADODB.Recordset");
ocrs.open(SQLString, "Provider=msdaora; Data Source=Source; User ID=UserID; Password=Password;");


specifically the line ocrs.open...

Any assist would be appreciated.

On a general theme, how can you do error trapping with Origin C?

Thanks,

Cheers,

Pete

cpyang

USA
1406 Posts

Posted - 11/24/2003 :  08:25:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use try catch,

 
SQLString = "select * table";
ocrs = CreateObject("ADODB.Recordset");
try {
ocrs.open(SQLString, "Provider=msdaora; Data Source=Source; User ID=UserID; Password=Password;");
}
catch(int nErr)
{
// err handling
}
// continue with other codes


Go to Top of Page

peter.cook

UK
356 Posts

Posted - 11/24/2003 :  10:05:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks CP.

Tried searching through help for 'error trapping', 'error trap' and only came up with erroproc macro. I guess this is standard C++?

Cheers,

Pete

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000