SELECT * "TYPE MISMATCH"

SELECT * "TYPE MISMATCH"

Post by R. Doornbosc » Wed, 27 Feb 2002 06:12:53



I've been using the code below for some time and have never had any
problems, all of a sudden the code has started giving me an error "Type
Mismatch". The Connection string is fine and the conenction opens perfect, I
get the error when I try and do the "SELECT * FROM Branches". I have tried
several different tables all with data in them and they all return the same
error. Can anyone tell me what the problem is?

Dim cnLocal As New ADODB.Connection
Dim rsLocal As New ADODB.Recordset

cnLocal.ConnectionString = Provider=MSDASQL.1;Persist Security
Info=False;Connect Timeout=15;Extended Properties="DSN=MS Access 97
Database;DBQ=E:\AbacusX\Code\Get Internet
Data\Database.mdb;DefaultDir=E:\AbacusX\Code\Get Internet
Data;DriverId=25;FIL=MS
Access;MaxBufferSize=2048;PageTimeout=5;UID=admin;";Locale Identifier=1033

    cnLocal.Open

    Set rsLocal = cnLocal.Execute("SELECT * FROM Branches")

 
 
 

SELECT * "TYPE MISMATCH"

Post by Bob » Wed, 27 Feb 2002 06:30:46


Have you tried using this
dim strQuery as string
dim CNN as new Adodb.Connection
dim strCNN as string
strCNN = "Providerstringhere"
CNN.open strcnn

strQuery = "Select * from tbl"

rs.open strQuery,CNN

rs = nothing
cnn.close
cnn = nothing

 
 
 

SELECT * "TYPE MISMATCH"

Post by R. Doornbosc » Wed, 27 Feb 2002 06:56:12


When I use your code or place a ADOdc on the form I get the error

"Run-Time 430"
"Class does not support Automation or does not support expected interface"


Quote:> Have you tried using this
> dim strQuery as string
> dim CNN as new Adodb.Connection
> dim strCNN as string
> strCNN = "Providerstringhere"
> CNN.open strcnn

> strQuery = "Select * from tbl"

> rs.open strQuery,CNN

> rs = nothing
> cnn.close
> cnn = nothing

 
 
 

SELECT * "TYPE MISMATCH"

Post by Han » Wed, 27 Feb 2002 07:08:45


Hi Doornbosch

Though you feel your connection is ok, still the connection can be a problem
maker. Without knowing you can change your MDAC or something on your
computer. Try this simplified connection and do,

str1="provider=microsoft.jet.oledb.4.0; data source=c:\db1.mdb"
conn.open str1

--
http://0000.info
Make Your IP Static


> When I use your code or place a ADOdc on the form I get the error

> "Run-Time 430"
> "Class does not support Automation or does not support expected interface"



> > Have you tried using this
> > dim strQuery as string
> > dim CNN as new Adodb.Connection
> > dim strCNN as string
> > strCNN = "Providerstringhere"
> > CNN.open strcnn

> > strQuery = "Select * from tbl"

> > rs.open strQuery,CNN

> > rs = nothing
> > cnn.close
> > cnn = nothing

 
 
 

SELECT * "TYPE MISMATCH"

Post by Simon Taylo » Wed, 27 Feb 2002 07:21:10


This is a COM error indicating that the QI (QueryInterface is called when
you set ref's to objects) didn't find the expected interface.  Something
probably hosed part of your MDAC install, or your registry.  I've also found
that monkeying around in OLE View can sometimes foul things up for COM
(which makes sense, since you can use OLE View to customize COM registry
settings).

You'll probably just need to reinstall MDAC.

Simon Taylor
Resource Data, Inc.


> When I use your code or place a ADOdc on the form I get the error

> "Run-Time 430"
> "Class does not support Automation or does not support expected interface"



> > Have you tried using this
> > dim strQuery as string
> > dim CNN as new Adodb.Connection
> > dim strCNN as string
> > strCNN = "Providerstringhere"
> > CNN.open strcnn

> > strQuery = "Select * from tbl"

> > rs.open strQuery,CNN

> > rs = nothing
> > cnn.close
> > cnn = nothing

 
 
 

SELECT * "TYPE MISMATCH"

Post by Simon Taylo » Wed, 27 Feb 2002 08:06:13


Oh yeah, I forgot to suggest...before you take the shotgun approach,
download the MDAC Component Checker from Microsoft.  That should help you
locate the conflicting parts of your MDAC install.

Simon Taylor
Resource Data, Inc.


> When I use your code or place a ADOdc on the form I get the error

> "Run-Time 430"
> "Class does not support Automation or does not support expected interface"



> > Have you tried using this
> > dim strQuery as string
> > dim CNN as new Adodb.Connection
> > dim strCNN as string
> > strCNN = "Providerstringhere"
> > CNN.open strcnn

> > strQuery = "Select * from tbl"

> > rs.open strQuery,CNN

> > rs = nothing
> > cnn.close
> > cnn = nothing

 
 
 

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. 'The process could not deliver the snapshot to the Subscriber.

3. Help: "Data type mismatch"

4. Should I migrate to RDO?

5. Handling "Type mismatch" error

6. SQL Probe--**FREE 30-DAY DEMO**

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

8. REQUEST: advice on selecting an MS Windows database application designer

9. HELP: "Type Mismatch" when opening recordset

10. Q: SQLForeignKeys gives "Type mismatch"

11. "Runtime Error 13 Data Type mismatch"

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

13. "String data, length mismatch"