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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql query

Status
Not open for further replies.

akshita

Programmer
Mar 26, 2002
25
0
0
IN
hi friends,

i am having one problem.i want to asign the value to a field when the table is created.

for eg in the query given below i want that password field should be assigned the value "doll" at the time when table is created.

strTable = "create table password1("
strTable = strTable & " password varchar(25),username varchar(50))"
Conn.Execute (strTable)


plzzzz suggest me the sol

akshita
 
Assuming you have the User's UserName (second column of your table) of you can do an INSERT right after the table is created by adding the following:

strTable = strTable & " GO INSERT INTO password1 VALUES ('doll','" & strUserName & "') GO"

Conn.Execute (strTable)


Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top