Hi.... I am a student.

When i tried to connect VB with Access, it is giving me this message "Run-time error 13, Type Mismatch" Below is the code

Dim DBase As Database
Dim RBase As Recordset

Set DBase = OpenDatabase("DB Name")
Set RBase = DBase.OpenRecordset("Table name")

The funniest thing is, this same code works on another project on the same computer.

Somebody help meeeeeeeeeeeee.

Recommended Answers

All 6 Replies

What is the version of the database you are having problems with? You may have to convert it to a previous version...

Another thought. Did you add the reference to the data access object?

Good Luck

if you want to use upper version of office then you need service pack 6 of vb6.

What is the version of the database you are having problems with? You may have to convert it to a previous version...

Another thought. Did you add the reference to the data access object?

Good Luck

Yes I add everything

if you want to use upper version of office then you need service pack 6 of vb6.

How can we get this service pack 6?

Dim DBase As Database
Dim RBase As Recordset

Set DBase = OpenDatabase("DB Name")
Set RBase = DBase.OpenRecordset("Table name")

Try to use database name and table names without spaces. eg: DBName , TableName...

Which line shows the error ?

Make sure that the data saved to the database is of the same datatype of those in the Fields...

eg: "abcd"(string) to IntegerField is not applicable...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.