Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO How to Create new table

Status
Not open for further replies.

DGA15

Programmer
Aug 19, 2000
40
US
I have just started using ADO instead of DAO.
Using VB6 - SP5.
How can I create a new table in an existing database I am connected to?
For example Create table "NewTable" with 2 fields ( "Fld1", "Fld2"). Fld1 is string and Fld2 is double. Already connected to the database with myCnn.

Sample code and suggestions greatly appreciated.
Billg in hot California.

 
hi,
u can do this

create table new(fld1 int,fld2 char(10))
i don't jnow whether u actually ,meant this.
 

-----------------------------------------------------------
Dim con As ADODB.Connection

set con = New ADODB.Connection
con.Open "Your connection string"
con.Execute "CREATE TABLE TblMyTable (field type,[field type])"
-----------------------------------------------------------

Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top