|
Okay, forgive me I usually use C# (and get better error messages with a line number and the code that errored out, which is set in the config file somewhere), but I believe this is wrong.
Dim Conn As New OdbcConnection("ConnStr")
You're supposed to pass that a connection, not a string.
Dim Conn As New OdbcConnection(ConnStr)
Note: no quotes.
So, no connection, which would make this line throw a nullpointerexception:
Conn.Open()
or maybe this one...
Dim Cmd As New OdbcCommand("SELECT anstext FROM Ans_Options", Conn)
No conn, no object. No object, nullpointerexception...
__________________
If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
|