
Command Object Problem in ADO
Hi there;
i hope some one can help mw with this;
let's say that i want to collect some data from text boxeson a form and
then i want to create a table in SQL server 7.o that is based on the
data i collected ; for an example:
let's say i have declared a globbal connection object in a .bas file
and named the object goConn;
in my Collect_Click() sub
Dim firstField as String
Dim secField as String
Dim myCommand as Command
Dim strSQL as String
' now I'll assign the first 2 variables with data from my text boxes
firstField = txtFirstField.Text
secFileld = txtSecField.Text
' Fire up the Command object
Set myCommand = new Command
Set myCommand.ActiveConnection = goConn
myCommand.CommandType = adCmdUnknown
' Now what i really wanna do is create a table in sql Server, and
name the fields or olumns in it whatever i have collected from the text
boxes?!! do you know what i mean
I can't just go and say
myCommand.CommandText = "Create Table test_Table ( firstField
char(5), secField char(6)"
because this is going to name the columns "firstField and secField" and
I want them to be named what ever those variables contain
does anybody understand what i'm talking about
hope so
please help
* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!