Re: Using SQL to create user defined table & column names



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


.



Relevant Pages

  • Re: Subform fields auto-filled based on Main form combo box value
    ... Set the combobox LimitToList property to No. ... of items they can select by setting the RowSource property? ... which has a combo box selecting Department from tblDEPTS ... automatically selected in the subform, Name combo Box with an ability ...
    (microsoft.public.access.forms)
  • Re: Subform fields auto-filled based on Main form combo box value
    ... Is there a table that stores names of all people who can be approvers? ... Set the combobox LimitToList property to No. ... of items they can select by setting the RowSource property? ... which has a combo box selecting Department from tblDEPTS ...
    (microsoft.public.access.forms)
  • Re: Subform fields auto-filled based on Main form combo box value
    ... of items they can select by setting the RowSource property? ... code modify the RowSource property then Requery the combobox. ... which has a combo box selecting Department from tblDEPTS ... automatically selected in the subform, Name combo Box with an ability ...
    (microsoft.public.access.forms)
  • Re: Subform fields auto-filled based on Main form combo box value
    ... Set the combobox LimitToList property to No. ... of items they can select by setting the RowSource property? ... which has a combo box selecting Department from tblDEPTS ... automatically selected in the subform, Name combo Box with an ability ...
    (microsoft.public.access.forms)
  • Re: Subform fields auto-filled based on Main form combo box value
    ... Set the combobox LimitToList property to No. ... of items they can select by setting the RowSource property? ... which has a combo box selecting Department from tblDEPTS ... automatically selected in the subform, Name combo Box with an ability ...
    (microsoft.public.access.forms)