Access Database VB6
Hi,
Im trying to access an MS Access 2003 database within VB6 Enterprise edition. I believe I have got all the code correct to simply edit, add and delete items within the table. However I cant seem to get the VB application to connect to the Database. Someone told me I needed to add the component 'Microsoft ActiveX Data Control 6' and create it into my program however when i goto the add components list this isnt there.
Any help would be greatly apreciated,
Kind Regards
Scott
# 1 Re: Access Database VB6
Try this. It doesn't do a lot, but it is 100% correct.
# 2 Re: Access Database VB6
The code in here is a little too complicated for me lol. I only know simple stuff that I learned at college.
Basically i have a module which is set to openrecordset, then throughout my program i have for example, database!1stcolum = lblTitle.caption etc
do you know how i define my database to work this style?
Kind Regards
Scott Roe
# 3 Re: Access Database VB6
The same way. That opens a recordset. What you want to do is INSERT,UPDATE,DELETE. That requires a little more work, but can be added to the basic code.
Post the code that you have.
# 4 Re: Access Database VB6
I dont have the actual code here on this computer, however it is something like:-
in my module i have:-
open recordset members (./members.mdb)
set table as members
then throughout the project i have etc:-
table.addnew
table!member = lblmember.caption
table.update
I can post the exact code tomorrow after work.
Thanks for your help
Scott
# 5 Re: Access Database VB6
Hi,
Sorry it took so long for me to post, i havent had the chance to use the computer this week.
The trouble i am having as you will see from the program is that i cannot get the database and the program linked. And im also having trouble getting the RTF file to save in frmMain.
Again, thankyou for your help.
Kind Regards
Scott
# 6 Re: Access Database VB6
Ouch. Next time, let us know that you split the zip into two parts. :(
Your code isn't even started. Take a look at this sample, which uses bound controls to edit a db. It's a start in the right direction.
EDIT: Oops. Max Compression. from 384 to 141kb