Solved

Insert data into Access database from VB 2005 form

Posted on 2007-12-01
2
5,104 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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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