Re: Using SQL to create user defined table & column names
- From: "Julian Madle" <julian@xxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 15:38:29 +0100
Very sorry - somehow my postings have been attached to your thread. Julian
"Instrat" <Instrat@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:83619361-A772-4FC1-8599-F7D0E5E7536B@xxxxxxxxxxxxxxxx
> New to this and need some help
> I want to alter tables in an existing Access database from VB6.
> 1. I want to be able to select the table from a combobox in the VB6 form.
> The combobox should therefore display the table names from the database
> 2. Once the table is selected then another combobox should display the
> column names.
> 3. on selecting the appropriate column name how does one edit this i.e
> rename it if needed using SQL
> 4. Alternatively how does one add a new column to the selected table using
> names defined at runtime?
>
> I have been able to do this using standard SQL statements
>
> db.execute " CREATE TABLE" & txtTable.text & "([col_name1] Text(50),
> [col_name2] Long)"
>
> The column names ( col_name1 & col_name2) is however hard coded. I would
> like to be able set the names and select the characteristics from the VB6
> form
>
> I am aware that using the
>
> db-execute " ALTER TABLE Table_name ADD Column_name datatype "
>
> code one can add a new column but again the table name and column name and
> datatype has to be hardcoded. Can someone help me get around this?
>
> Your help would be highly appreciated
.
- Prev by Date: Lookup executes 3 time upon Recordset.Save
- Next by Date: Lookup executes 3 time upon Recordset.Save
- Previous by thread: Lookup executes 3 time upon Recordset.Save
- Next by thread: How do I set the DateTimeMode property when filling a DataTable
- Index(es):
Relevant Pages
|