Solved

Access SQL stored procedure error

Posted on 2014-11-14
7
301 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 46

Expert Comment

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

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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 33

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 33

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dimension table indexes 8 10
Batch/VBScript : Disable Windows tasks 7 23
SQL server is using more virtual memory. 5 67
Sql Query 4 14
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…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
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 …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

911 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

23 Experts available now in Live!

Get 1:1 Help Now