Results 1 to 4 of 4

Thread: adding a field?

  1. #1
    Wayne Twitchell Guest

    adding a field?

    Sorry if this has been asked or is in V2 but...

    is there any way to use aspdb or an sql command to add anew FIELD to a database? How about renaiming the field (not using the as command but actually renaming the field).
    I am putting together a generic survey maker for our school and I wanted to set it up so that the users could edit and add questions for a simple 1-5 answer survey via a web interface. Any help /advice greatly appreciated.

  2. #2
    Frank Guest

    adding a field? (reply)

    Wayne,
    no need to wait for V2 to do this (V2 is a super heavy weight !!). Check out Q29 of my FAQ. Better, I cut and paste for you as follows. The silent SQL commands are executed before ASPDB is activates usin the same connection. So you can update, create (incl. a blank DB in V2), delete etc....

    Frank

    Q29. Is there any way to execute stored procedures or SQL statements with no data returns before opening the recordset for browsing?

    A. Use the dbSilentCmdText property: dbSilentCmdText = "(;,)Command text [,Type][,Tout]". When this property is not blank, it will be executed before the main SQL statement is executed. The type should be either adCmdText (1=default) or adCmdStoredProc (4) while Tout defaults to 30 seconds. DbSilentCmdText is a multiple property and supports user controlled delimiters. Multiple property means it can hold repeated entries up to the 64K limit.

    Example :
    X.dbSilentCmdText="(;+)UPDATE Daily_Cane SET Car_no=9999,Quota_no=99, _
    Type=99 WHERE Billno=20001 + 1 + 30; UPDATE Daily_Cane SET Car_no=8888, _
    Quota_no=88, Type=88 WHERE Billno=20002"

    This example UPDATEs 2 records before proceeding to execute the regular dbSQL statement.



    On 2/6/99 3:03:46 PM, Wayne Twitchell wrote:
    > Sorry if this has been asked or is in V2 but...

    is there any way to use
    > aspdb or an sql command to add anew FIELD to a database? How about
    > renaiming the field (not using the as command but actually renaming the
    > field).
    I am putting together a generic survey maker for our school and I
    > wanted to set it up so that the users could edit and add questions for a
    > simple 1-5 answer survey via a web interface. Any help /advice greatly
    > appreciated.

  3. #3
    Wayne Twitchell Guest

    adding a field? (reply)

    A. Use the dbSilentCmdText property: dbSilentCmdText =
    > "(;,)Command text [,Type][,Tout]". When this property is not blank,
    > it will be executed before the main SQL statement is executed. The type
    > should be either adCmdText (1=default) or adCmdStoredProc (4) while Tout
    > defaults to 30 seconds. DbSilentCmdText is a multiple property and supports
    > user controlled delimiters. Multiple property means it can hold repeated
    > entries up to the 64K limit.
    I am sorry but I don't know SQL at all well would you be so kind as to tell me what command or string I should use in order to create a new field (not record)?
    Thank you for your help and time.

  4. #4
    John Guest

    adding a field? (reply)

    Hi Wayne,

    Our job is really not to teach SQL - that's Steve Wynkoop's forte! Still, I think the command you want is "ALTER TABLE".

    Here's an example:

    ALTER TABLE Employees ADD COLUMN Salary CURRENCY;

    This adds a column to the Employees table named "Salary" of type Currency.

    Good luck!
    John

    On 2/6/99 5:37:34 PM, Frank wrote:
    > Wayne,
    no need to wait for V2 to do this (V2 is a super heavy weight !!).
    > Check out Q29 of my FAQ. Better, I cut and paste for you as follows. The
    > silent SQL commands are executed before ASPDB is activates usin the same
    > connection. So you can update, create (incl. a blank DB in V2), delete
    > etc....

    Frank

    Q29. Is there any way to execute stored procedures or
    > SQL statements with no data returns before opening the recordset for
    > browsing?

    A. Use the dbSilentCmdText property: dbSilentCmdText =
    > "(;,)Command text [,Type][,Tout]". When this property is not blank,
    > it will be executed before the main SQL statement is executed. The type
    > should be either adCmdText (1=default) or adCmdStoredProc (4) while Tout
    > defaults to 30 seconds. DbSilentCmdText is a multiple property and supports
    > user controlled delimiters. Multiple property means it can hold repeated
    > entries up to the 64K limit.

    Example :
    >
    X.dbSilentCmdText="(;+)UPDATE Daily_Cane SET Car_no=9999,Quota_no=99,
    > _
    Type=99 WHERE Billno=20001 + 1 + 30; UPDATE Daily_Cane SET Car_no=8888,
    > _
    Quota_no=88, Type=88 WHERE Billno=20002"

    This example UPDATEs 2
    > records before proceeding to execute the regular dbSQL statement.



    On
    > 2/6/99 3:03:46 PM, Wayne Twitchell wrote:
    > Sorry if this has been asked
    > or is in V2 but...

    is there any way to use
    > aspdb or an sql command
    > to add anew FIELD to a database? How about
    > renaiming the field (not
    > using the as command but actually renaming the
    > field).
    I am putting
    > together a generic survey maker for our school and I
    > wanted to set it
    > up so that the users could edit and add questions for a
    > simple 1-5
    > answer survey via a web interface. Any help /advice greatly
    > appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •