VB6 - Access Database

Reply

Join Date: Nov 2009
Posts: 3
Reputation: Jaisonkv is an unknown quantity at this point 
Solved Threads: 0
Jaisonkv's Avatar
Jaisonkv Jaisonkv is offline Offline
Newbie Poster

VB6 - Access Database

 
0
  #1
23 Days Ago
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

  1. Dim DBase As Database
  2. Dim RBase As Recordset
  3.  
  4. Set DBase = OpenDatabase("DB Name")
  5. Set RBase = DBase.OpenRecordset("Table name")

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

Somebody help meeeeeeeeeeeee.
Last edited by peter_budo; 23 Days Ago at 8:42 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 810
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 147
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark
 
0
  #2
22 Days Ago
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 anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #3
21 Days Ago
if you want to use upper version of office then you need service pack 6 of vb6.
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: Jaisonkv is an unknown quantity at this point 
Solved Threads: 0
Jaisonkv's Avatar
Jaisonkv Jaisonkv is offline Offline
Newbie Poster
 
0
  #4
16 Days Ago
Originally Posted by vb5prgrmr View Post
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 3
Reputation: Jaisonkv is an unknown quantity at this point 
Solved Threads: 0
Jaisonkv's Avatar
Jaisonkv Jaisonkv is offline Offline
Newbie Poster
 
0
  #5
16 Days Ago
Originally Posted by abu taher View Post
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 471
Reputation: abu taher is an unknown quantity at this point 
Solved Threads: 24
abu taher's Avatar
abu taher abu taher is offline Offline
Posting Pro in Training
 
0
  #6
16 Days Ago
here and here and here
I like sword. Attack or Defense.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 14
Reputation: akhileshbc is an unknown quantity at this point 
Solved Threads: 4
akhileshbc's Avatar
akhileshbc akhileshbc is offline Offline
Newbie Poster
 
0
  #7
16 Days Ago
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...
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC