Show me the code where you add the actual data. Include the entire sub, i.e., if it is under a command button click event, show all the code under the event. It sounds like the add new is actually editing.
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
This part looks fine -
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
'Just add the Adodcq.RecordSet.Update
End Sub
As you have mentioned, you have tried that as well, no luck, mmmmm....
To your last question, a bit confusing. Do you want code for add new data WITHOUT using an adodc control?
If so, then the following -
Dim cnConn As ADODB.COnnection
Set cnCon = New ADODB.Connection
cnCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=YourDataBasePathHere\YourDatabaseNameHere.MDB;Persist Security Info=False"
Dim rsAdd As ADODB.Recordset
Set rsAdd.Recordset = New ADODB.Recordset
rsAdd.Open "SELECT * FROM MyTableNameHere", cnCon, adOpenStatic, adLockOptimistic
rsAdd.AddNew
rsAdd!MyFirstFieldNameHere = txtMyTextboxNameHere.Text
rsAdd.Update
rsAdd.Close
cnCon.Close
This should do:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Pleasure:)
That is why it is ALWAYS better to go adodb way. There is really only about 4 important sql statements to learn that will do most of what you require in an application.
Please mark this thread as solved, re-open a new post with your question about e-mail and I will gladly help you there. The reason being is to keep one post to one specific question, thanks:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Thank you very much, your code works!!!! Now i have a project in my mind. Is it possible to built e-mail based application which send/recieve e-mail and can send reminder / follow up automatically to recevier if he dosnot reply the e-amil sent to him. The projetc is mostly on self generating e-mail. I am not sure how to start this one. I am using VB.6. I would appreciate you if through some light in this regards. I am joining a team of expert on this project and i want to equip myself with all necessary information to start with this project so that i could be an asset for the team and not a liablity. Thank you.
Would be better to create new thread and ask there instead of diverting discussion from original topic.
PS: Do not forget to mark thread as solved (there is a link bellow last post)
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902