Friday, August 08, 2008   
  Search  
 
Register  Login  
Forums  
     Minimize  

Welcome to MeraWindows forums.

Thank you for being at the Microsoft Windows Community Site. You may have to register before posting in forums. It's absolutely free. After registering, you can get all the benefits available to our registered members, you can access our Downloads section, you can participate in contests, etc. You can post in forums in English as well as in Hindi, in fact we encourage you to use Hindi in your posts. If you have any problem with registration or login, please contact us.

     
  


 
  Microsoft Windows Forums  Security Center  One Care  problem in adding a record in VB
Previous Previous
 
Next Next
New Post 11/17/2007 9:07 PM
User is offline 009
14 posts
Member


problem in adding a record in VB 
Whenever I try to add any record in MSSQL 2000 server using recordset.Addnew of VB 6.0, when the table is empty...it gives an eeror abt EOF and BOF...I can work on tables if the table contains atleast 1 row or more.
 
New Post 11/17/2007 11:46 PM
User is offline Ramesh
2283 posts
Forum Guru








Re: problem in adding a record in VB 
Modified By Ramesh   on 11/17/2007 11:56:06 PM)

Welcome to Mera Windows Community !

Buddy....I think you have to execute SQL queries to add, delete or for data manipulation......using VB...

Here is a example, to add or insert data into table.

Sub AddRecord()

    Dim dbs As Database

    ' Modify this line to include the path to database file on your computer.
    Set dbs = OpenDatabase("MyDatabase.mdb")
   
    'Create a new record in the Employees table. The first name is Ramesh, the last name is Kumar, and the job title is Trainee.

    dbs.Execute " INSERT INTO Employees " _
        & "(FirstName,LastName, Title) VALUES " _
        & "('Ramesh', 'Kumar', 'Trainee');"
              
    dbs.Close

End Sub


Ramesh Kumar [Microsoft MVP]
 
New Post 11/18/2007 3:15 AM
User is offline Vishal Gupta
5794 posts
www.AskVG.com
Ultimate Member








Re: problem in adding a record in VB 

Welcome to the forum buddy and try Ramesh method. It should work.


Microsoft Windows MVP

Tweaking with Vishal

How to Use Smiley Code in Forum?
Promote MeraWindows at Your Blog / Site
Read Forum Guidelines
 
Previous Previous
 
Next Next
  Microsoft Windows Forums  Security Center  One Care  problem in adding a record in VB
   Get Your Own E-Mail Account @MeraWindows.com Minimize  
New Page 1 New Page 1
Show your cool quotient with @merawindows.com email account