a blank form to insert data????

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 3
Reputation: kasra is an unknown quantity at this point 
Solved Threads: 0
kasra kasra is offline Offline
Newbie Poster

a blank form to insert data????

 
0
  #1
May 6th, 2007
hi every1..
i have a form with a register butoon...when the button is pressed, the registration form (which is connected to ms access) opens...but the problem is that the form displays the data stored in table..although i need a blank form, which allows users to insert data...

any emergency reply appritiated...
tnx in advance
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 181
Reputation: scudzilla is an unknown quantity at this point 
Solved Threads: 3
scudzilla's Avatar
scudzilla scudzilla is offline Offline
Junior Poster

Re: a blank form to insert data????

 
0
  #2
May 6th, 2007
If there are any textboxes in the form (which I'm sure there are), don't connect them to the database. Then if there is a button that adds the data into the database, then get the data from the textboxes then add them to the database.
There are 10 types of people: those who understand Binary and those who don't!
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 3
Reputation: kasra is an unknown quantity at this point 
Solved Threads: 0
kasra kasra is offline Offline
Newbie Poster

Re: a blank form to insert data????

 
0
  #3
May 10th, 2007
Originally Posted by scudzilla View Post
If there are any textboxes in the form (which I'm sure there are), don't connect them to the database. Then if there is a button that adds the data into the database, then get the data from the textboxes then add them to the database.
hello..for the process that u mentioned, i have 2 open a connection in click event of that button and assign every text box to database with a recordset...right???...but how can i do that??//...bcz i'm really new to VB and i gotstuck...
help me plz...tnx
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 45
Reputation: ReeciePoo is an unknown quantity at this point 
Solved Threads: 0
ReeciePoo's Avatar
ReeciePoo ReeciePoo is offline Offline
Light Poster

Re: a blank form to insert data????

 
0
  #4
May 10th, 2007
Originally Posted by kasra View Post
hello..for the process that u mentioned, i have 2 open a connection in click event of that button and assign every text box to database with a recordset...right???...but how can i do that??//...bcz i'm really new to VB and i gotstuck...
help me plz...tnx
I use
Dim rstRecordSet As RecordSet

'Connection Info Here' Make sure you open the database to "Write"

With rstRecordSet
.AddNew
.Fields(0) = Text1.Text
.Fields(1) = Text2.Text
.Fields(2) = Text3.Text
.Fields(3) = Text3.Text
.Update
End With

^^ That should be your answer? not sure if thats what you wanted but let me know
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 3
Reputation: kasra is an unknown quantity at this point 
Solved Threads: 0
kasra kasra is offline Offline
Newbie Poster

Re: a blank form to insert data????

 
0
  #5
May 10th, 2007
yea, i think..it should work...but what are the connection info????....as long as i'm using data control...
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 45
Reputation: ReeciePoo is an unknown quantity at this point 
Solved Threads: 0
ReeciePoo's Avatar
ReeciePoo ReeciePoo is offline Offline
Light Poster

Re: a blank form to insert data????

 
0
  #6
May 11th, 2007
Dim conConnection As New ADODB.Connection
  Dim cmdCommand As New ADODB.Command
  Dim rstRecordSet As New ADODB.Recordset


  'Defines the connection string for the Connection.  Here we have used fields
  'Provider, Data Source and Mode to assign values to the properties
  ' conConnection.Provider and conConnection.Mode

  conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
      App.Path & "\" & "database.mdb;Mode=Read|Write"


  'Define the location of the cursor engine, in this case we are opening an Access database
  'and adUseClient is our only choice.

  conConnection.CursorLocation = adUseClient


  'Opens our connection using the password "Admin" to access the database.  If there was no password
  'protection on the database this field could be left out.

  conConnection.Open
That will open a connection for you, change to what you please (the file name i mean)
(o(o.(o.O).O)O) - Shhhhh They're Watchin Us!!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC