Q: SQLForeignKeys gives "Type mismatch"

Q: SQLForeignKeys gives "Type mismatch"

Post by Thoralf Nordt?mm » Sat, 26 Oct 1996 04:00:00

Hi everyone,
I hope some of you may help me with a problem calling the SQLForeignKeys
ODBC-function from VB 4.0 Enterp. Ed. 16-bit

I get Run-Time error 13: "Type mismatch"

It seems that it's the "tabnam" parameter that causes this, as using
NULL_POINTER instead don't give this error.
Yes, I know: This param. is supposed to be "ByVal PTName&" acc. to the
API, but how the heck do I get a LONG POINTER from a String???

Any suggestions?

<Start Snip>

'  ----
Sub GetForKey(tabnam As String)
   Dim cursor As Long
   RetCode =3D SQLAllocStmt(hdbc, cursor)
   If (RetCode =3D SQL_SUCCESS Or RetCode =3D SQL_SUCCESS_WITH_INFO) Then=

      RetCode =3D SQLForeignKeys(cursor, _
                             NULL_POINTER, 0, _
                             NULL_POINTER, 0, _
                             tabnam,       Len(tabnam), _ ' Decl. as
"ByVal PTName&, ByVal PTName%"
                             NULL_POINTER, 0, _
                             NULL_POINTER, 0, _
                             NULL_POINTER, 0)
<End Snip>
-- =

  Thanks for any help, =

  Sysdeco Media AS


1. Spooky "Type Mismatch in Expression" problem

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?

2. 11803-NY-New York City-C-ORACLE-SQL*Plus-UNIX-Securities Compliance experience-Programmer

3. Handling "Type mismatch" error

4. pdox 5 and quattro 6

5. "Runtime Error 13 Data Type mismatch"

6. 125 queries

7. Help: "Data type mismatch"

8. need help for copy database


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

11. HELP: "Type Mismatch" when opening recordset

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

13. "String data, length mismatch"