|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Newbie question on access database.
Firstly, I have no idea how to program in VB whatsoever, so please forgive the obvious mistakes.
I have Visual Studio .NET Enterprise Architect and I need to create a program that deletes a table from an access database (db1.mdb) and then inserts into that same database a table from another database (update.mdb). The table is called "Master" in both access database files. Like so: Step 1: Remove table "Master" from db1.mdb Step 2: Insert table "Master" from update.mdb into db1.mdb Step 3: Report completion and close. Does anyone know how to do this or can you point me in the right direction? I haven't the slightest idea how to even start. Many thanks for your help.
__________________
When in doubt, ask them who know. |
|
#2
|
|||
|
|||
|
I think you can somehow link the two db's together in your code and then use normal sql to copy the table, but I wouldn't know the details either.
There are excellent Access and VB sections at www.mvps.org with many many code samples, FAQ's, etc. Perhaps there are examples there.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
||||
|
||||
|
Thanks Doug, I'll see what I can find.
|
|
#4
|
||||
|
||||
|
I haven't been able to find anything, really.
Nothing that looks like it will do what I want to do. I can program this in ASP easily, but I would really like to make a VB or C# application to do it with. Unfortunately I haven't the slightest clue how. Any suggestions? How do I create a form and database connection in an executable? How do I build an event for the click of the button? Things like that. |
|
#5
|
||||
|
||||
|
Here is the code I have so far.
What I need to do with it is to make an event for the click of the button that removes the table "Master" from file "db1.mdb" and replaces it with the table "Master" from file "update.mdb". Code:
Imports System Imports System.Drawing Imports System.Windows.Forms Namespace Updater Public Class MainForm Inherits System.Windows.Forms.Form Private Conndb1 As System.Data.OleDb.OleDbConnection Private button1 As System.Windows.Forms.Button Private Connupdate As System.Data.OleDb.OleDbConnection Private label1 As System.Windows.Forms.Label Public Shared Sub Main Dim fMainForm As New MainForm fMainForm.ShowDialog() End Sub Public Sub New() MyBase.New Me.InitializeComponent End Sub #Region " Windows Forms Designer generated code " Private Sub InitializeComponent() Me.label1 = New System.Windows.Forms.Label Me.Connupdate = New System.Data.OleDb.OleDbConnection Me.button1 = New System.Windows.Forms.Button Me.Conndb1 = New System.Data.OleDb.OleDbConnection Me.SuspendLayout Me.label1.Location = New System.Drawing.Point(16, 8) Me.label1.Name = "label1" Me.label1.Size = New System.Drawing.Size(112, 40) Me.label1.TabIndex = 0 Me.label1.Text = "Click the button below to update your master database." Me.Connupdate.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=update.mdb" Me.button1.Location = New System.Drawing.Point(40, 56) Me.button1.Name = "button1" Me.button1.Size = New System.Drawing.Size(56, 40) Me.button1.TabIndex = 1 Me.button1.Text = "Update" Me.Conndb1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=db1.mdb" Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(144, 110) Me.Controls.Add(Me.button1) Me.Controls.Add(Me.label1) Me.Name = "MainForm" Me.Text = "Update" Me.ResumeLayout(false) End Sub #End Region End Class End Namespace any ideas or assistance or pointers in the right direction? I don't know how to build events. |
|
#6
|
|||
|
|||
|
I didn't find much on the subject by searching either, here is one google search that might have something for you
http://www.google.com/search?q=vb+c...:en-US:official If you have SQL Server, you probably could use DTS Your code looks like VB.Net, perhaps you can get more from the NET forum? I don't know VB.Net myself, sorry I haven't been much help! |
|
#7
|
||||
|
||||
|
DOH!
You are right, of course. VBnet is what I'm using. I'll move the topic over there. Thanks for the link, lots of great stuff in it. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Newbie question on access database. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|