|
-
Jan 6th, 2005, 03:52 PM
#1
Thread Starter
New Member
ADO!! i think
I have created a MS access DB with 2 tables, PlayersDatabase and ManagerDetails
I have used a data environment called FantasyFootballDB and 2 commands Players (PlayerDatabaseTbl) and Managers (ManagerDetailstbl) i have copied them over to my form and created navigational buttons which works fine. However i want to be able to add details in the textbox and click on the button so that the new player can be added to the database i have this but it doesnt work
FantasyfootballDB.rsplayers.addnew
im quessing i need more code for it work, be grateful with all and any help
-
Jan 7th, 2005, 08:10 AM
#2
Re: ADO!! i think
Investigate SQL. A simple INSERT INTO statment should work fine for you.
-
Jan 7th, 2005, 09:11 AM
#3
Addicted Member
Re: ADO!! i think
ADO is a nasty little piece of work, that only works when it feels like it...i have similar programs all with similar code, some choose to work while others choose not to..
unless i am needing to preform sql searchs, display into a datatable or have the database available to multiple users - i much prefer to use DAO
contuary to what alot of people think DAO does still work with the new versions of MS Access, you simply have to go into project references and tell vb to use DAO 3.6....
anyway now to the code...
as started above first go into project preferences and tick the DAO 3.6
dim mydata as DAO.Database
dim myrecord as DAO.RECORDSET
private sub command1_click()
set mydata = open database("path to database")
set myrecord = database.recordset("tablename)
myrecord.Movelast
myrecord.Add
myrecord!NAME = "johnsmith" or text1.text
myrecord.update
end sub
Rob
hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|