473,569 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange Issue / DB Error / Not Showing Error Message

Good morning all,

I am trying to access an access database to authenticate users upon
logging into my application.

Something is throwing an excecption. My error handling code should
display this message in a msgbox. However, the messagebox is always
empty.

Here is my error handling code.

Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.OKO nly)
Finally
oleConn.Close()
End Try

Return bolTemp
End Function

Am I missing something? Do I have to include any system libraries for
error handling? Very confusing.....

Thanks in advance!

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #1
13 1626
If you step through the code, when entering the Catch block the ide's
exception helper should pop up if you hover over "catch ex as
exception" line. See if that gives any additional information. If that
doesn't help solve the problem then what code is causing the error?

Thanks,

Seth Rowe
Ivan Weiss wrote:
Good morning all,

I am trying to access an access database to authenticate users upon
logging into my application.

Something is throwing an excecption. My error handling code should
display this message in a msgbox. However, the messagebox is always
empty.

Here is my error handling code.

Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.OKO nly)
Finally
oleConn.Close()
End Try

Return bolTemp
End Function

Am I missing something? Do I have to include any system libraries for
error handling? Very confusing.....

Thanks in advance!

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #2
Ivan Weiss wrote:
Good morning all,

I am trying to access an access database to authenticate users upon
logging into my application.

Something is throwing an excecption. My error handling code should
display this message in a msgbox. However, the messagebox is always
empty.
Do you, by chance, run McAfee Virus Scanner? That can cause the
message box to be blank. They have released a patch to fix the
problem.

If you search these groups, you should find more information on it as
it pops up occaisionally.

Chris

Oct 11 '06 #3
Chris,

I do happen to have Mcafee Virus Scan installed. I could not find
anything on that. Do you happen to know where I can get the patch. I
tried searching on Mcafee web site as well...

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #4
Seth,

It did not display any further information.

Here is the code: It is a function within a User class that I am using
to authenticate my user that is logging in. I simply put in a user name
and a password and hit submit and it references this class:

Public Function ValidUser(ByVal UserName As String, ByVal Password As
String) As Boolean
Dim bolTemp As Boolean = False

Try
strSQL = "SELECT Roles FROM Employees WHERE (UserName = " &
UserName & ") AND (Password = " & Password & ")"
oleConn = New OleDbConnection (strConString)
oleCmd = New OleDbCommand

oleConn.Open()

With oleCmd
.CommandText = strSQL
.CommandType = CommandType.Tex t
.Connection = oleConn
oleReader = .ExecuteReader( CommandBehavior .SingleRow)
End With

While oleReader.Read
bolTemp = True
UserRole = oleReader(0)
End While

oleReader.Close ()
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.OKO nly)
Finally
oleConn.Close()
End Try

Return bolTemp
End Function
-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #5
UserRole = oleReader(0)

What is UserRole? Also is this the line that is throwing the error? If
not which line is?

Thanks,

Seth Rowe
Ivan Weiss wrote:
Seth,

It did not display any further information.

Here is the code: It is a function within a User class that I am using
to authenticate my user that is logging in. I simply put in a user name
and a password and hit submit and it references this class:

Public Function ValidUser(ByVal UserName As String, ByVal Password As
String) As Boolean
Dim bolTemp As Boolean = False

Try
strSQL = "SELECT Roles FROM Employees WHERE (UserName = " &
UserName & ") AND (Password = " & Password & ")"
oleConn = New OleDbConnection (strConString)
oleCmd = New OleDbCommand

oleConn.Open()

With oleCmd
.CommandText = strSQL
.CommandType = CommandType.Tex t
.Connection = oleConn
oleReader = .ExecuteReader( CommandBehavior .SingleRow)
End With

While oleReader.Read
bolTemp = True
UserRole = oleReader(0)
End While

oleReader.Close ()
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.OKO nly)
Finally
oleConn.Close()
End Try

Return bolTemp
End Function
-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #6
UserRole is a property:

Public Property UserRole() As String
Get
If strUserRole <"" Then
Return strUserRole
Else
MsgBox("You are not Logged in. System will Exit.
Restart and Login")
Application.Exi t()
End If
End Get
Set(ByVal Value As String)
strUserRole = Value
End Set
End Property

After this line is run, it goes to the error handling code so this must
be the culpret but I have no clue why:

oleReader = .ExecuteReader( CommandBehavior .SingleRow)

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 12 '06 #7

Ivan Weiss wrote:
Chris,

I do happen to have Mcafee Virus Scan installed. I could not find
anything on that. Do you happen to know where I can get the patch. I
tried searching on Mcafee web site as well...

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
http://tinyurl.com/k8jgx

Oct 12 '06 #8
oleReader = .ExecuteReader( CommandBehavior .SingleRow)

Let's pull this out of the with block and drop the parameter.

i.e.

oleReader = objCmd.ExecuteR eader()

Also I didn't see anywhere that you dimensioned the oleReader object.
Is this done somewhere other than in the code you supplied?

Thanks,

Seth Rowe
Ivan Weiss wrote:
UserRole is a property:

Public Property UserRole() As String
Get
If strUserRole <"" Then
Return strUserRole
Else
MsgBox("You are not Logged in. System will Exit.
Restart and Login")
Application.Exi t()
End If
End Get
Set(ByVal Value As String)
strUserRole = Value
End Set
End Property

After this line is run, it goes to the error handling code so this must
be the culpret but I have no clue why:

oleReader = .ExecuteReader( CommandBehavior .SingleRow)

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 12 '06 #9
Hi Seth,

That Mcafee issue did solve the disappearing message box screen and now
I am getting some actual errors.

Adjusting the olereader outside of the With block and removing the
parameter did not help.

Here is the general dimensioning of variables for the class. It is
coded prior to any properties or subs

Private strConString As String = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\Docum ents and Settings\iweiss \My Documents\elite .mdb;User
Id=admin;Passwo rd=;"
Private oleCmd As OleDbCommand
Private oleConn As OleDbConnection
Private oleReader As OleDbDataReader
Private strUserRole As String = ""
Private strSQL As String = ""

The errors in the message box are as follows:

"No Value given for one or more required parameters."

Thanks for your help thus far.

PS--- I cant find that patch to resolve the virusscan issue other than
manually disabling buffer overrun so if anyone has it or knows
specifically where to get it that would help!

-Ivan

*** Sent via Developersdex http://www.developersdex.com ***
Oct 16 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1982
by: kajol | last post by:
Hi everyone I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got a URL "http://www.bizrate.com/" which is causing a system error and the error is System.Runtime.InteropServices.COMException(0xC00CE56E): System error:- 1072896658
3
1664
by: Jason | last post by:
I have two applications that I wrote that use asp and javascript source files. Recently both of these applications starting acting strange on my test box. Image icons will randomly stop showing up and any javascript that I use a src file with <script language="javascript" src="mytest.js"></script> ) returns random errors. Javascript on...
3
3160
by: Don McNamara | last post by:
Hi, I've hit quite a strange problem with XmlSerializer on my W2K3 server. When I serialize/deserialize using an exe on my local computer (XP), everything works fine. When I put the code out on the server (W2K3) it throws an exception. It only seems to happen when serializing/deserializing _arrays_ of a type. If I just serialize/deserialize...
9
2188
by: Wescotte | last post by:
Here is a small sample program I wrote in PHP to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using the iSeries Client Access Driver ver 10.00.04.00 to connect to the database. The problem is that executing the exact same SQL select statement more than twice int a row stops produces...
25
3705
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's machines. The code opens MS Word through Automation and then opens a particular Word doc. It's still working fine on most machines; but on one or two of...
3
4861
by: Sebastian C. | last post by:
Hello everybody Since I upgraded my Office XP Professional to SP3 I got strange behaviour. Pieces of code which works for 3 years now are suddenly stop to work properly. I have Office XP Developer (SP3 for Office, SP1 for developer, JET40SP8) on Windows XP Home Edition (SP1). The same behaviour occurs on Windows 98 too.
5
1249
by: Simon Verona | last post by:
I have a strange problem with a Windows Forms application. It installs and runs fine on my development machine but consistently comes up with errors on any installed machine. I get an error about an unhandled exception as the application starts up. If I go to debugger I get the error showing as : Unhandled exception generated:...
5
3101
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view showing a list of jobs from the database. When the main form loses focus and the user clicks the 'Close' button, I kept receiving error 2585 (This...
11
2473
by: Mike C# | last post by:
Hi all, I keep getting a strange error and can't pin it down. The message is: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. However I'm not purposely requesting that the Runtime terminate in an "unusual way." The line that is causing...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.