Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access SQL stored procedure error

Posted on 2014-11-14
7
Medium Priority
?
308 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 52

Expert Comment

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

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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 35

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 35

Assisted Solution

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

Independent Software Vendors: 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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

704 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