Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Insert Procedure

New Here ,
Nov 29, 2006 Nov 29, 2006
I am trying to get an insert procedure to add a date and also a product number to my database.

i tried using...
INSERT INTO InvReview (Date, ProductNum)
VALUES (ReviewDate, ReviewStockNum)
with the variables
ReviewDate (Date())
ReviewStockNum (InvReview.Fields.Item("ProductNum").Value)

the date will work ok but i cannot seem to figure out how to get the ProductNum from my recordset into the database.
how can i get a dynamic field into my stored procedure
TOPICS
Server side applications
274
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2006 Dec 01, 2006
LATEST
This is untested,

dim varProdNum

varProdNum = InvReview.Fields.Item("ProductNum").Value

sql = "INSERT INTO InvReview (Date,ProductNUM)"
sql = sql & " VALUES "
sql = sql & "('" & Date() & "'," & varProdNum & ")"

'execute the insert to SQL Server
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_YourStringHere_STRING
MM_editCmd.CommandText = sql
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

Drew



"acidrain9" <webforumsuser@macromedia.com> wrote in message
news:ekkumv$kh3$1@forums.macromedia.com...
>I am trying to get an insert procedure to add a date and also a product
>number
> to my database.
>
> i tried using...
> INSERT INTO InvReview (Date, ProductNum)
> VALUES (ReviewDate, ReviewStockNum)
> with the variables
> ReviewDate (Date())
> ReviewStockNum (InvReview.Fields.Item("ProductNum").Value)
>
> the date will work ok but i cannot seem to figure out how to get the
> ProductNum from my recordset into the database.
> how can i get a dynamic field into my stored procedure
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines