Spooky "Type Mismatch in Expression" problem

Spooky "Type Mismatch in Expression" problem

Post by David Carl » Wed, 02 Apr 1997 04:00:00

Using Delphi 2.0 with Paradox 7 tables
I posted a question about getting  a "Type Mismatch in Expression" error
when trying to assign initial values within the OnNewRecord event of a
TQuery called quCallHdr
eg:  dmData.quCallHdrCHPriority.AsString:= '5';
Rob Tanner suggested:   dmData.quCallHdrCHPriority.AsInteger := 5;
(Thanks), but this made no difference.
I have now moved this initialisation to the OnFormShow event of the next
form - and it works again. This is OK as a workaround (except that it
probably sets the queries' modified property) but I'd be interested in
any ideas why Delphi is getting upset. Especially as a) it used to work
as written, and b) it works when initialising other fields. Suggestions?


1. HELP: "Type Mismatch" when opening recordset

I am trying to put all records between two dates into a recordset.
However, with the following piece of code, Visual Basic 4.0 (Enterprise)
screams "Error 13 - Type Mismatch" when it gets to the line to open the

Temp is never defined.  Text1 through Text6 should contain numeric values.
 The database object (DataNarf) does work... it works everywhere else in
the program...

---- BEGIN CODE ----

temp = text1.Text & "/" & Text2.Text & "/" & Text3.Text
StartDate = CDate(temp)

temp = Text4.Text & "/" & Text5.Text & "/" & Text6.Text
EndDate = CDate(temp)

SQL$ = "Select * from Server_Callinfo Where CallTime BETWEEN '" &
StartDate & "' AND '" & EndDate & "'"

Set RecordZort = DataNarf.OpenRecordset(SQL$, dbOpenDynaset)

---- END CODE ----

If you can figure out what I'm doing wrong, please email me.  I've got a
deadline breathing down my neck... :/

2. Information vs. User


4. Data Source Class

5. Handling "Type mismatch" error

6. Oracle 7.2 ODBC Driver !!!

7. Help: "Data type mismatch"

8. default passwords for 8

9. "Run-time error 13: Type Mismatch"

10. Q: SQLForeignKeys gives "Type mismatch"

11. "Runtime Error 13 Data Type mismatch"

12. max of ("...","...","..")

13. Problem with "image" data type