Solved

Insert data into Access database from VB 2005 form

Posted on 2007-12-01
2
5,103 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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