|
-
May 15th, 2003, 12:46 AM
#1
ADO causes VB to crash?
I am trying to return a recordset and I get the error:
"This program has performed an illegal operation and will be shut down.
If the problem persiss, contact the program vendor", then Visual Basic 6 crashes and I have to reload.
On occasion, when I reload VB I ge the following error:
"An unexpected error has occured!"
Error Number 462
The remote server machine does not exist or is unavailable."
Has anyone heard of this happening before? Below you will find my code, thanks in advance for any help!
Dim rsLvSec As ADODB.Recordset
Set rsLvSec = New ADODB.Recordset
Dim sSql As String
'sSql = "SELECT SY0MNU_MenuFile.ApplicationCode, SY1MNU_MenuCrossReference.TaskNumber, SY1MNU_MenuCrossReference.Description FROM SY1MNU_MenuCrossReference WHERE SY1MNU_MenuCrossReference.Module = SY0MNU_MenuFile.ApplicationCode ORDER BY SY1MNU_MenuCrossReference.TaskNumber"
Dim NodeAdo As ADODB.Connection
Set NodeAdo = New ADODB.Connection
Dim sConnect As String
sConnect = "Provider=MSDASQL.1;Extended Properties='DSN=SOTAMAS90;CacheSize=4;DirtyReads=1;BurstMode=1;SERVER=NotTheServer'"
'sSql = "SELECT SY1MNU_MenuCrossReference.TaskNumber, SY1MNU_MenuCrossReference.Description, SY1MNU_MenuCrossReference.ProgramName, SY1MNU_MenuCrossReference.Module, SY1MNU_MenuCrossReference.MenuNumber, SY1MNU_MenuCrossReference.OptionNumber, SY0MNU_MenuFile.ApplicationCode, SY0MNU_MenuFile.RecordType From SY0MNU_MenuFile, SY1MNU_MenuCrossReference WHERE SY1MNU_MenuCrossReference.Module=SY0MNU_MenuFile.ApplicationCode"
sSql = "SELECT SY0SEC_SystemSecurityFile.UserCode, SY0SEC_SystemSecurityFile.UserName, SY0SEC_SystemSecurityFile.GroupCode "
sSql = sSql + "From SY0SEC_SystemSecurityFile "
sSql = sSql + "WHERE SY0SEC_SystemSecurityFile.UserName like '%%%%" + Nodeclicked + "'"
MsgBox sSql
NodeAdo.Open sConnect
rsLvSec.Open sSql, NodeAdo, adOpenDynamic, adLockOptimistic
'Dim ixx As String
'ixx = rsLvSec
Dim Bob As String
'rsLvSec
'rsLvSec.MoveLast
'rsLvSec.MoveFirst
Bob = rsLvSec(0)
MsgBox Bob
end sub
Thanks,
Bob
-
May 15th, 2003, 03:24 AM
#2
Have you installed last Ado? (=mdac_typ.exe from www.microsoft.com)
Have you installed servicepack for Vb6 (servicepack 5 should be the last)
...
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
May 15th, 2003, 10:55 PM
#3
Service Pack 5, the latest for VB6 is installed and the latest I believe the latest for MDAC as well. I am stumped on this one.
Bob
-
May 16th, 2003, 09:38 AM
#4
What is the database you're trying to connect to? Make sure you have the proper provider and parameters for that provider ...
-
May 16th, 2003, 08:11 PM
#5
Good suggestion, although I did have the connection string set as the following:
Dim sConnect As String
sConnect = "Provider=MSDASQL.1;Extended Properties='DSN=SOTAMAS90;CacheSize=4;DirtyReads=1
;BurstMode=1;SERVER=NotTheServer'"
I'll continue to look around on this issue, although I have to admit, this one has me stumped.
Bob
-
May 16th, 2003, 08:20 PM
#6
Again.. What is the driver/database/backend you are trying to use?
Busy 
-
May 17th, 2003, 01:36 PM
#7
The database is a providex database. Unless you are familiar with it, it wouldn't make much sense to you. However, I am merely using the Providex ODBC driver to commincate with the Providex files, which are flat files, not tables.
Do you believe the connection string is in error?
Bob
-
May 19th, 2003, 09:01 PM
#8
Nope, the connection string is just fine, I guess it's the driver.. And refrain from using Dynamic cursor..
Busy 
-
May 20th, 2003, 06:16 PM
#9
I doubt it is the driver for this reason. If the driver was bad, VB should be able to handle that error and provide a fileIO, table not accessible error. However, this does not happen, but rather, as I stated before, VB crashes all togethor. I believe there is a bad api call somewhere in VB.
As a matter of fact, I have recently noticed that the next time I open VB it compains about an error (I think error 432, I don't have the specifics on me at this point).
-
May 20th, 2003, 08:33 PM
#10
The driver runs on a separate thread as hosted by the ADO.. But as what you've said, I think that's is terrible
As a matter of fact, I have recently noticed that the next time I open VB it compains about an error (I think error 432, I don't have the specifics on me at this point).
But, even if you had open-up a new project? Well, if that's the case, I'll go get again the VB installation procedure..
Last edited by Thread1; May 20th, 2003 at 08:36 PM.
Busy 
-
May 20th, 2003, 09:51 PM
#11
If I am reading your reply correctly, I believe you are suggesting to reinstall VB?
If so, I agree... I just haven't had time... It'll be my next task on the list (I was trying to avoid a reinstall, but what the heck...)
Bob
-
May 20th, 2003, 09:53 PM
#12
Oh... but I should say this... I only get the follow up error (error 432 if memory serves me right) after the orignial error. Again, VB crashes, then the next time I open VB an error 432 occurs.
The error 432 only occurs once, then it doesn't appear to hinder any other operations. If I close VB then reopen, the error 432 does not occur.
Bob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|