Solved

Access SQL stored procedure error

Posted on 2014-11-14
7
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 51

Expert Comment

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

Expert Comment

by:ste5an
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 34

Expert Comment

by:ste5an
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 34

Assisted Solution

by:ste5an
ste5an 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

630 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