0

Ok, so here's the problem:
I have a database with tables made with Microsoft Access.
I know how to connect to this databse, and retrieve information in the tables, and update the information in the tables.
I was hoping someone could help me with the code for inserting new tables, and possibly modifying columns in existing tables in the database.
I am using the free vb2005

Table1 = New DataTable("studentCP414")
Dim Row1 As DataRow
Try
  Dim fName As DataColumn = New DataColumn("firstName")
    fName.DataType = System.Type.GetType("System.String")
    Table1.Columns.Add(fName)
    Row1 = Table1.NewRow()
    Row1.Item("fName") = "Reddy"
Catch
End Try

Is how I assume I'm suppose to make a table, but how do I insert this table into a database?

Edited by pritaeas: Removed bbcode.

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by molze
0

something like

SELECT "firstname" as FirstName, "lastname" as LastName INTO newTable;

or if you are putting data in the new table from another then

SELECT "firstname" as FirstName, "lastname" as LastName INTO newTable from OldTable;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.