Re: fun with odbc... :-(

Tech-Archive recommends: Fix windows errors by optimizing your registry



Bob Barrows [MVP] wrote:
Volker Hetzer wrote:

Hi!
I'm trying to use odbc.


Your first mistake ;-)
http://www.aspfaq.com/show.asp?id=2126
Ok, I tried a connection string, if I really need to use
odbc or oledb I'll try again.


So far I've got a dsn, can connect,

execute a query and retrieve the rows.
However, upon script exit the script crashes.

This is my script:

set db=createobject("ADODB.Connection")
db.open("dsn=ecadbib;uid=layoutchecks_hetzer;pwd=layoutchecks_hetzer")


You probably should have censored the password ...
Don't worry about the password :-)



set Rows=db.execute("select sysdate from dual")
do until Rows.EOF
msgBox(Rows("SYSDATE"))
Rows.MoveNext
loop
Rows.Close
msgbox("Here")
db.Close
msgbox("Here")

Now, whenever I leave out one of the two message boxes (or both),
the script crashes. It also crashes when I use wscript.createobject
instead of just createobject.


What kind of crash? Are you forced to reboot your machine? Kill the process using Task Manager? Do you get an error message?
I get a message, looks like a typical memory error. (Instruction at 0x7c921e58
points to 0xffffffff.)


FWIW, I see nothing glaringly wrong here.

Maybe try explicitly setting the ADO objects to Nothing:
Rows.Close: Set Rows=Nothing
db.Close: Set db = Nothing
Tried that too, no difference.

I'm beginning to suspect oracles odbc driver.
However, since using oracles own oledb server works flawlessly
I'm inclined to use that one, unless my boss forces me into the standard
driver.

Lots of Greetings and thanks!
Volker
.



Relevant Pages

  • Re: Migrating to OLEDB
    ... Certainly OLE DB is extremely flexible and I certainly understand that the ... in making a decision to use OLE DB over ODBC for a "typical" application. ... I am presently grappling with problems with OLEDB in our own application (an ... request a Forward-Only, Static, Keyset Driven, or Dynamic cursor type ...
    (microsoft.public.data.odbc)
  • Re: Migrating to OLEDB
    ... Certainly OLE DB is extremely flexible and I certainly understand that the ... in making a decision to use OLE DB over ODBC for a "typical" application. ... I am presently grappling with problems with OLEDB in our own application (an ... request a Forward-Only, Static, Keyset Driven, or Dynamic cursor type ...
    (microsoft.public.data.oledb)
  • Re: VFP Updates?
    ... Try talking ODBC or OleDb and they say HU. ... make up my apps so that what ever they want to run has to be from a command ... kind of connection and assign it the right to do exactly what you want. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Migrating to OLEDB
    ... See 30 well-tested and real OLEDB examples ... In our tests the ODBC ... to have LOTS of features and to support ... >> YCY> Specifically, SQL Server and Oracle providers are faster than ...
    (microsoft.public.data.oledb)
  • Re: Migrating to OLEDB
    ... See 30 well-tested and real OLEDB examples ... In our tests the ODBC ... to have LOTS of features and to support ... >> YCY> Specifically, SQL Server and Oracle providers are faster than ...
    (microsoft.public.data.odbc)