Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 1st, 2005, 07:22 PM
XandarX's Avatar
XandarX XandarX is offline
Scrambled asp with bacon
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Seattle
Posts: 266 XandarX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 46 m 45 sec
Reputation Power: 5
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.

Reply With Quote
  #2  
Old June 2nd, 2005, 06:58 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
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

Reply With Quote
  #3  
Old June 2nd, 2005, 08:30 PM
XandarX's Avatar
XandarX XandarX is offline
Scrambled asp with bacon
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Seattle
Posts: 266 XandarX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 46 m 45 sec
Reputation Power: 5
Thanks Doug, I'll see what I can find.

Reply With Quote
  #4  
Old June 6th, 2005, 04:29 PM
XandarX's Avatar
XandarX XandarX is offline
Scrambled asp with bacon
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Seattle
Posts: 266 XandarX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 46 m 45 sec
Reputation Power: 5
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.

Reply With Quote
  #5  
Old June 6th, 2005, 05:09 PM
XandarX's Avatar
XandarX XandarX is offline
Scrambled asp with bacon
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Seattle
Posts: 266 XandarX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 46 m 45 sec
Reputation Power: 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.

Reply With Quote
  #6  
Old June 6th, 2005, 05:22 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
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!

Reply With Quote
  #7  
Old June 6th, 2005, 05:59 PM
XandarX's Avatar
XandarX XandarX is offline
Scrambled asp with bacon
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Seattle
Posts: 266 XandarX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 9 h 46 m 45 sec
Reputation Power: 5
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Newbie question on access database.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT