Solved

Insert data into Access database from VB 2005 form

Posted on 2007-12-01
2
5,087 Views
Last Modified: 2013-11-26
I have a Visual Basic form where data is entered.  I need to insert this data into an Access database but I don't know the code.  I am a newbie at this.
0
Comment
Question by:MyTime2Live
2 Comments
 
LVL 2

Accepted Solution

by:
telefonia earned 500 total points
ID: 20390344
   '''''''############## Example code
        Dim oled1 As System.Data.OleDb.OleDbConnection
        Dim dir As String = System.Environment.CurrentDirectory & "\mybase.mdb"
       oled1 = New  System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dir & ";Persist Security Info=True")
Dim insert as string = "Insert Into table(col1,col2)values('" & texthere1 & "', '" & texthere2 & "')"
Dim insertcomand as new  System.Data.OleDb.Oledbcommand(insert, oled1)
oled1.open()
insertarcommand.executenowquery()
oled1.close()


       
0
 

Author Closing Comment

by:MyTime2Live
ID: 31412167
When I said I was a newbie I really meant a newbie so I had to work some to understand this answer.  It was accurate but a little above my level.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now