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
- RE: a bit of vba, a bit of sql
... number from the combobox 'indirectly' by selecting the patient's name. ...
> to be MR_Number in your case) as the Control Source Property. ... > See http://www.QBuilt.com
for all your database needs. ... (microsoft.public.access.formscoding) - Re: Databound combobox, new and selected value confusion.
... The SelectionChangeCommitted event for the combobox occurs before the ... Member
are both bound to ProjectName, which is the column in the ... then the call to EndEditproduces
an exception: ... The intention of selecting items in the combobox is that this
effects ... (microsoft.public.dotnet.languages.csharp) - RE: Combobox display on startup
... I used a combobox from the forms command bar for a range of years, ...
When I went through the same process with a combobox from the control ... >> by selecting
the Year from a range of years and Category from a range of ... (microsoft.public.excel.newusers) - display of a combobox (should be simple..)
... The control source is based on ... combobox when making a choice. ...
sufficient width, then it looks fine for selecting a value, but when ... text will it alter
the fields in the table it's based on?) ... (microsoft.public.access.forms) - Re: Ctrl+Enter on a combobox automatically selects item beginning with
... bearing the following fruit: ... Surely this has to be a bug in the combobox.
... I'm using VB6 on Windows 2000 Professional. ... (microsoft.public.vb.controls)