Solved

Access SQL stored procedure error

Posted on 2014-11-14
7
298 Views
Last Modified: 2014-11-19
I have an Access 2007 app that updates a field on a SQL table using a SQL stored procedure.

On one users PC they get "Error 13 Type Mismatch". I tried logging in as them on my PC and it works fine.

I'm using a DSN less connection string could this be the issue? e.g.
Const strCon = "Provider=SQLOLEDB.1;Data Source=MYSERVER;Initial Catalog=MYDB;User Id=User;Password=Password"
0
Comment
Question by:HKFuey
  • 3
  • 3
7 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 40442136
The stored procedure receives any parameter?
0
 
LVL 32

Expert Comment

by:Stefan Hoffmann
ID: 40442164
A type mismatch error occurs when you rely on implicit converts. Thus a string is as assigned to a number, but the content is not one. The first candidate are different regional and date/time settings. Access/VBA can only handle US date in a save manner. Another problem may be different thousand separator and comma settings.

And last, but not least, an user input is used without validation. And the user has entered invalid data.
0
 

Accepted Solution

by:
HKFuey earned 0 total points
ID: 40442276
Complete Red Herring this one. I thought it was failing on the SP but it actually failed on the bit where I check the form fields are filled in! (If field ="" then exit..)
I removed the checking and it works.

Not sure why it worked on my full Access but not on a users runtime version?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 32

Expert Comment

by:Stefan Hoffmann
ID: 40442506
What does field refer to? It may contain NULL or StringEmpty for different reasons.
0
 

Author Comment

by:HKFuey
ID: 40442583
All I'm doing is:-
if isnull(field) or field ="" then
msgbox "Blah"
exit sub
End if

Changed to this and it works fine, not sure why?

If Len(Me!TxtCustPO) = 0 Then
MsgBox "Enter PO number!"
Exit Sub
End If
If IsNull(Me!TxtCustPO) Then
MsgBox "Enter PO number!"
Exit Sub
End If
0
 
LVL 32

Assisted Solution

by:Stefan Hoffmann
Stefan Hoffmann earned 500 total points
ID: 40442680
NULL and empty string are different.

Thus the good 'ol (field & "") = "" or Len(field & "") > 0 test. Cause even when field is NULL adding an emptry string will give you always an empty string.
0
 

Author Closing Comment

by:HKFuey
ID: 40451917
Thanks.

This normally works for me, must be because it's Friday
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now