Thread: ODBC driver causes VB to crash
Howdy everyone, I'm getting this weird error with PostgreSQL odbc version 7.02.00.01 and visual basic. I've had good luck with this DLL and VB6 in the past. I swear, all i did was save the project in VB:) (no, seriously) and when i try to execute the line: rs.Open "select * from custom_phases", cn, adOpenKeyset, adLockOptimistic I get an application error, details below: First this pops up: vb6.exe Application Error The instruction at "0x043dabb5" referenced memory at "0x7ffffffc". The memory could not be read. Which brings up the debugger, which tells me: Unhandled exception in VB6.EXE(PSQLODBC.DLL) 0xC0000005 Access Violation Then there's a whole bunch of garbage, with a little yellow arrow pointing to this line: 043DABB5 mov byte ptr [edi+esi],0 think i just need to totally remove the PG odbc driver and reinstall? Or do i need to tell my boss i need a new workstation? ;) thanks in advance corey
Just a follow up, I dropped the table, recreated it, and threw some records back into it and it worked. Weird eh? corey On Tuesday, August 06, 2002 10:23 AM, Corey Gibbs [SMTP:cgibbs@westmarkproducts.com] wrote: > Howdy everyone, > > I'm getting this weird error with PostgreSQL odbc version 7.02.00.01 and > visual basic. I've had good luck with this DLL and VB6 in the past. > I swear, all i did was save the project in VB:) (no, seriously) and when i > try to execute the line: > rs.Open "select * from custom_phases", cn, adOpenKeyset, adLockOptimistic > > I get an application error, details below: > > First this pops up: > vb6.exe Application Error > The instruction at "0x043dabb5" referenced memory at "0x7ffffffc". The > memory could not be read. > > Which brings up the debugger, which tells me: > Unhandled exception in VB6.EXE(PSQLODBC.DLL) 0xC0000005 Access Violation > > Then there's a whole bunch of garbage, with a little yellow arrow pointing > to this line: > 043DABB5 mov byte ptr [edi+esi],0 > > > think i just need to totally remove the PG odbc driver and reinstall? Or > do i need to tell my boss i need a new workstation? ;) > > thanks in advance > corey > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> -----Original Message----- > From: Corey Gibbs [mailto:cgibbs@westmarkproducts.com] > Sent: 06 August 2002 18:23 > To: pgsql-odbc@postgresql.org > Subject: [ODBC] ODBC driver causes VB to crash > > > Howdy everyone, > > think i just need to totally remove the PG odbc driver and > reinstall? Or > do i need to tell my boss i need a new workstation? ;) I'd go with the new workstation! Seriously though, it's *very* unlikely that a reinstall of psqlODBC will fix things - it's only one .dll and a few registry entries. Feel free to try though.... I would be more inclined to reinstall MDAC and double check your code. Regards, Dave.
Hey Dave, Ok i reinstalled the MDAC, and the same thing happened in a different application. Here's what seemed to cause it. I think it's limited to VB6, i have not tried this on a production database/program yet. I close VB6 I Open PGAdmin-2 (the stable release) I modify the table in some way with PGA-2 in both of my cases it was to add a column, the other was to rename a column save the changes open VB6 and try to run the rs.open"hodeyhodeyhodeyho" (sorry, listening to cab calloway right now ;)) line i get the same access violation. So, i go drop the table, and recreate it in PGAdmin-2 and viola it runs fine. Weird eh? Is there any information I can provide to the developers that would help? thank you corey On Wednesday, August 07, 2002 12:51 AM, Dave Page [SMTP:dpage@vale-housing.co.uk] wrote: > > > > -----Original Message----- > > From: Corey Gibbs [mailto:cgibbs@westmarkproducts.com] > > Sent: 06 August 2002 18:23 > > To: pgsql-odbc@postgresql.org > > Subject: [ODBC] ODBC driver causes VB to crash > > > > > > Howdy everyone, > > > > think i just need to totally remove the PG odbc driver and > > reinstall? Or > > do i need to tell my boss i need a new workstation? ;) > > I'd go with the new workstation! > > Seriously though, it's *very* unlikely that a reinstall of psqlODBC will > fix things - it's only one .dll and a few registry entries. Feel free to > try though.... > > I would be more inclined to reinstall MDAC and double check your code. > > Regards, Dave. > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
the PGAdmin theory wasn't it. But, what i did find was if i did rs.Open"SELECT field1,field2,..." instead of "SELECT * ..." it worked. I've run into the * problem with other tables before, but those tables had like 40 columns with real long column names. This table only had 8 columns with modertly short column names. So, four hours later... I did find out it was a VB problem, my PG server was passing all requested data back, but VB was choking on it (imagine that) thanks for feedback, i think i've earned that new workstation ;) corey On Wednesday, August 07, 2002 12:51 AM, Dave Page [SMTP:dpage@vale-housing.co.uk] wrote: > > > > -----Original Message----- > > From: Corey Gibbs [mailto:cgibbs@westmarkproducts.com] > > Sent: 06 August 2002 18:23 > > To: pgsql-odbc@postgresql.org > > Subject: [ODBC] ODBC driver causes VB to crash > > > > > > Howdy everyone, > > > > think i just need to totally remove the PG odbc driver and > > reinstall? Or > > do i need to tell my boss i need a new workstation? ;) > > I'd go with the new workstation! > > Seriously though, it's *very* unlikely that a reinstall of psqlODBC will > fix things - it's only one .dll and a few registry entries. Feel free to > try though.... > > I would be more inclined to reinstall MDAC and double check your code. > > Regards, Dave.
> -----Original Message----- > From: Corey Gibbs [mailto:cgibbs@westmarkproducts.com] > Sent: 07 August 2002 23:02 > To: Dave Page; pgsql-odbc@postgresql.org > Subject: RE: [ODBC] ODBC driver causes VB to crash > > > the PGAdmin theory wasn't it. But, what i did find was if i > did rs.Open"SELECT field1,field2,..." instead of "SELECT * > ..." it worked. > > I've run into the * problem with other tables before, but > those tables had > like 40 columns with real long column names. This table only > had 8 columns > with modertly short column names. > > So, four hours later... > I did find out it was a VB problem, my PG server was passing > all requested > data back, but VB was choking on it (imagine that) > > thanks for feedback, i think i've earned that new workstation ;) Glad to hear it's working now. Incidently (for future reference), pgAdmin is written in VB6 and uses ADO/MDAC, so if it works OK, then it's a reasonable assumtion that MDAC & ODBC are OK. Regards, Dave.