Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13)
Type mismatch (ERROR 13) Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Go Back  Xtreme Visual Basic Talk > > > Type mismatch (ERROR 13)


Reply
 
Thread Tools Display Modes
  #1  
Old 12-28-2003, 08:58 AM
tor37 tor37 is offline
Newcomer
 
Join Date: Dec 2003
Posts: 14
Default Type mismatch (ERROR 13)


Hi

Have a big problem with my project in visual basic 6.0.
Using MYSQL database, connected localy and connection to
a mysql db on the internet.

Here is the code where i get the error 13.


Code:
Do While Not rsor.EOF ibonr = rsor!nnet_table_head_customer uppline = finn_oppline(ibonr) List1.AddItem "nummer 14" & ibonr & uppline datomnd = Int(Mid(rsor!nnet_table_head_regdate, 4, 2)) List1.AddItem "nummer 14-2" & datomnd dataar = Int(Mid(rsor!nnet_table_head_regdate, 7, 4)) List1.AddItem "nummer 14-3" & dataar s31 = Str(dataar) + Str(datomnd) List1.AddItem "nummer 14-4" & s31 datokd = Val(s31) s33 = Str(sponset.Combo2.Text) + Str(sponset.Combo1.ListIndex + 1) datokd2 = Val(s33) List1.AddItem "nummer 15" 'tot = rsor!nnet_table_head_netsum 'stot = str(tot) 'stot = Replace(stot, ",", ".") If Int(datokd) <> Int(datokd2) Then ' ibo2 = ibonr GoTo neste2 End If If forste = True Then ibo2 = ibonr forste = False End If If ibonr = ibo2 Then tot = tot + rsor!nnet_table_head_netsum opj = True If ibonr <> ibo2 Then List1.AddItem "nummer 16" stot = Str(tot) stot = Replace(stot, ",", ".") ' Legg inn ny record i bonustabell ' finnes = finnesbonus(ibo2) uppline = finn_oppline(ibo2) ' If finnes = False Then ' sSQL = "INSERT INTO " & tblbonus & " (ibonr,datokode,uppline,pv1,year2) VALUES('" & ibo2 & "','" & datokd & "','" & uppline & "','" & stot & "','" & dataar & "')" ' Else ' List1.AddItem "DATO KODE 2 = " & datokd sSQL = "UPDATE " & tblbonus & " SET ibonr='" & ibo2 & "',uppline='" & uppline & "',pv1='" & stot & "',year2='" & dataar & "' WHERE ibonr LIKE " & ibo2 & " AND datokode LIKE " & datokd2 'WHERE ibonr LIKE '" & ibonr & "' AND datokode LIKE '" & dk ' End If List1.AddItem "nummer 17" Call db_allaccess(sSQL) List1.AddItem "nummer 18" ibo2 = ibonr tot = rsor!nnet_table_head_netsum opj = False dk2 = datokd End If neste2: rsor.MoveNext Loop



On my computer the program works just fine. But when i try it on another computer i get the error 13.

Have debugd the program code, and get this values from
nummer 14-4 : 2003 11 ---> running om my computer
nummer 14-4 : 2003 24 ---> running on another computer

Have this variables declaration

Code:
Dim navn As String Dim email As String Dim ibonr As String Dim ibo2 As String Dim ibo As String Dim datomnd As Integer Dim dataar As Integer Dim tot As Double Dim stot As String Dim idupp As Double Dim uppline As String Dim dako As Long Dim fi As Long Dim ib As String Dim opj As Boolean Dim ID As Long Dim s31, s33 As String Dim datokd As Double Dim datokd2 As Double Dim ik As Long


What is wrong ?????

Please can sombody help me with this strange error


Thanks
Tor

Last edited by Deadalus; 12-28-2003 at 06:06 PM. Reason: Added tags. Please use VB tags to post VB code.
Reply With Quote
  #2  
Old 12-28-2003, 02:39 PM
vbQuestor vbQuestor is offline
Freshman
 
Join Date: Mar 2003
Location: Tampa, Fl
Posts: 40
Default

TOR, have you tried stepping thru the procedure to find out which line is generating the error? Most Type Mismatch errors occur when you try to load or convert alpha or null strings into numeric variables. The are a ton of data conversions going on in your code. I suspect a null string is in there somewhere.
Reply With Quote
  #3  
Old 12-28-2003, 03:04 PM
tor37 tor37 is offline
Newcomer
 
Join Date: Dec 2003
Posts: 14
Default Yes.....

Quote:
Originally Posted by vbQuestor
TOR, have you tried stepping thru the procedure to find out which line is generating the error? Most Type Mismatch errors occur when you try to load or convert alpha or null strings into numeric variables. The are a ton of data conversions going on in your code. I suspect a null string is in there somewhere.




Hello

But why is the program running just fine on my computer.
And not on onother computer ???

Have checked all my strings and numeric variables. But what
is funny is that then line List1.additem "nummer 14-4" & s31

Print out nummer 14-4 2003 24 : on my freands computer
and print out 14-4 2003 11 : on my computer

2003 is the year and 11 (24) is the month

Maby its somthing wrong with some dll or somthing ?

Have innstalled servicepack 5, but this dosent solve the problem.

Do you have any ide what to check ?

Thanks for your help

Tor
Reply With Quote
  #4  
Old 12-28-2003, 03:24 PM
Shurik12Type mismatch (ERROR 13) Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
 
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
Default

Hi,

Seems to be that
rsor!nnet_table_head_regdate field formatted differently when returned
on your pc and that one of your friend.

Regards,
Shurik.


p.s. to increase a chance to be helped I'd strongly recommend to use
[vb]
....
]/vb]

tags when publishing your code on the forum (it's all about readability)
__________________
"A diaper is not like a computer that makes satisfying burbling noises from time to time, hinting at great inner complexity." Malcolm Gladwell

"I'm sitting here completely surrounded by no beer." Onslow, 'Keeping up appearances'
Reply With Quote
  #5  
Old 12-28-2003, 03:51 PM
herilane's Avatar
herilaneType mismatch (ERROR 13) herilane is offline
Unashamed geek

Retired Moderator
* Expert *
 
Join Date: Jul 2003
Location: London, England
Posts: 8,988
Default

Could be due regional settings: US vs UK date formats are different, one is yyyy-dd-mm and the other is yyyy-mm-dd.

If you have a date string and are trying to extract the month, it's better to use DateValue to convert the string into a date, and Month to extract the month:
Code:
MsgBox Month(DateValue("2003-11-24"))
Reply With Quote
  #6  
Old 12-28-2003, 05:01 PM
tor37 tor37 is offline
Newcomer
 
Join Date: Dec 2003
Posts: 14
Default DateValue...

Quote:
Originally Posted by herilane
Could be due regional settings: US vs UK date formats are different, one is yyyy-dd-mm and the other is yyyy-mm-dd.

If you have a date string and are trying to extract the month, it's better to use DateValue to convert the string into a date, and Month to extract the month:
Code:
MsgBox Month(DateValue("2003-11-24"))




Thanks for the tip, this must bee the problem.

But why do i get error 13 on this code:

datomnd = Int(Mid(rsor!nnet_table_head_regdate, 4, 2))

Mid function can't generate this error ?? Or can it

Will try your sugestion tomorow. Thanks

And hope that error 13 is history.

Thanks for your help

Tor
Reply With Quote
  #7  
Old 12-29-2003, 10:13 AM
tor37 tor37 is offline
Newcomer
 
Join Date: Dec 2003
Posts: 14
Thumbs up Yes, the problem is solved

Quote:
Originally Posted by herilane
Could be due regional settings: US vs UK date formats are different, one is yyyy-dd-mm and the other is yyyy-mm-dd.

If you have a date string and are trying to extract the month, it's better to use DateValue to convert the string into a date, and Month to extract the month:
Code:
MsgBox Month(DateValue("2003-11-24"))



Used the Month(DateValue("2003-11-24")) Funtion
and that solve the problem.

Thanks so very match for help

Tor
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
type mismatch problem Sdfd General 16 08-22-2003 02:41 PM
Type Mismatch lordofdalite Web Programming 2 06-11-2003 12:23 AM
Type mismatch error sigsy General 2 03-23-2003 09:14 AM
Type mismatch khchan General 1 11-14-2002 06:41 AM
Help Me...GURU Luckyboy General 10 10-22-2001 09:08 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13) Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13) Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
 
Type mismatch (ERROR 13)
Type mismatch (ERROR 13)
 
-->