Proper Syntax Passing Multi Variables to Function

Proper Syntax Passing Multi Variables to Function

am 12.11.2004 07:52:47 von Gz

Hello. I am trying to write a function that will insert data into a table.
The function will accept the field names as inputs of which there are eight.
I keep getting a compilation error
Function InsertLifeLine( Stepdate-, STep-, PN-, SN-, SO-, Pass-, Fail-,
DrNumber- )
-----------------------------------^Is it correct to separate the variable
name with commas? Is this possible? I am having to rebuild the SQL string in
my *.asp, as I cannot figure out how to call query that exist in the
MSACCESS *.mdb. When program inside MSACCESS, I can success fully call the
query when I open the recordset withRS.OPEN QUERYNAME,
CurrentProject.ConnectionWHen I try this to open my recordset with the query
name in *.asp it chokes. Thank in advance for any help code
snippet:'-----START OF NEW FUNCTION-----Function InsertLifeLine( Stepdate-,
STep-, PN-, SN-, SO-, Pass-, Fail-, DrNumber- )'----------------'I added a -
to the end of each parameter name to prevent the table field name being'the
same'this function enters stuff into tblLifeLine'It will get call after each
get function '-----------------Dim StrInsertDim objConnInsertDim
ObjRSInsertSet objConnInsert = Server.CreateObject("Adodb.Connection")Set
ObjRSInsert = Server.CreateObject("Adodb.RecordSet")StrInsert = "INSERT INTO
tblLIFELINE ( Stepdate, STep, PN, SN, SO, Pass, Fail, DrNumber ) VALUES
"StrInsert = StrInsert & "(#" Stepdate- & "#," & step- & "," & pn- & "," &
sn- & "," StrInsert = StrInsert & so- & "," & pass- & "," & fail- & "," &
DrNumber- & ");"Response.Write StrInsert & "
"ObjConnInsert.Open
strConnObjRSInsert StrInsert, objConnInsert'Close and clean
upObjRSInsert.CloseSEt objRSInsert = NothingObjConnInsert.CloseSEt
objConnInsert = NothingEnd Function

Re: Proper Syntax Passing Multi Variables to Function

am 12.11.2004 12:59:15 von reb01501

Gz wrote:
> Hello. I am trying to write a function that will insert data into a
> table. The function will accept the field names as inputs of which
> there are eight. I keep getting a compilation error
> Function InsertLifeLine( Stepdate-, STep-, PN-, SN-, SO-, Pass-,
> Fail-, DrNumber- )
> -----------------------------------^Is it correct to separate the
> variable name with commas? Is this possible? I am having to rebuild
> the SQL string in my *.asp, as I cannot figure out how to call query
> that exist in the MSACCESS *.mdb. When program inside MSACCESS, I can
> success fully call the query when I open the recordset withRS.OPEN
> QUERYNAME, CurrentProject.ConnectionWHen I try this to open my
> recordset with the query name in *.asp it chokes. Thank in advance
> for any help code snippet:'-----START OF NEW FUNCTION-----Function
> InsertLifeLine( Stepdate-, STep-, PN-, SN-, SO-, Pass-, Fail-,
> DrNumber- )'----------------'I added a - to the end of each parameter
> name to prevent the table field name being'the same'this function
> enters stuff into tblLifeLine'It will get call after each get
> function '-----------------Dim StrInsertDim objConnInsertDim
> ObjRSInsertSet objConnInsert =
> Server.CreateObject("Adodb.Connection")Set ObjRSInsert =
> Server.CreateObject("Adodb.RecordSet")StrInsert = "INSERT INTO
> tblLIFELINE ( Stepdate, STep, PN, SN, SO, Pass, Fail, DrNumber )
> VALUES "StrInsert = StrInsert & "(#" Stepdate- & "#," & step- & "," &
> pn- & "," & sn- & "," StrInsert = StrInsert & so- & "," & pass- &
> "," & fail- & "," & DrNumber- & ");"Response.Write StrInsert &
> "
"ObjConnInsert.Open strConnObjRSInsert StrInsert,
> objConnInsert'Close and clean upObjRSInsert.CloseSEt objRSInsert =
> NothingObjConnInsert.CloseSEt objConnInsert = NothingEnd Function

Due to the formatting, I was unable to wade through your message, but I
think you will benefit from this:
Access:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=eHYxOyvaDHA.4020%40tk2msftngp13.phx.gbl

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1& selm=ukS%246S%247CHA.2464%40TK2MSFTNGP11.phx.gbl

http://www.google.com/groups?selm=eETTdnvFDHA.1660%40TK2MSFT NGP10.phx.gbl&oe=UTF-8&output=gplain

http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&sel m=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Proper Syntax Passing Multi Variables to Function

am 14.11.2004 00:44:04 von Jeff Dillon

Obviously you've tried removing the "-" character at the end of each
variable name? How do people troubleshoot these days?

This works:
<%
function test (ie)

end function
%>

This doesn't compile:

<%
function test (ie-)

end function
%>

Jeff
"Gz" wrote in message
news:##gmpQIyEHA.3844@TK2MSFTNGP09.phx.gbl...
> Hello. I am trying to write a function that will insert data into a table.
> The function will accept the field names as inputs of which there are
eight.
> I keep getting a compilation error
> Function InsertLifeLine( Stepdate-, STep-, PN-, SN-, SO-, Pass-, Fail-,
> DrNumber- )
> -----------------------------------^Is it correct to separate the variable
> name with commas? Is this possible? I am having to rebuild the SQL string
in
> my *.asp, as I cannot figure out how to call query that exist in the
> MSACCESS *.mdb. When program inside MSACCESS, I can success fully call the
> query when I open the recordset withRS.OPEN QUERYNAME,
> CurrentProject.ConnectionWHen I try this to open my recordset with the
query
> name in *.asp it chokes. Thank in advance for any help code
> snippet:'-----START OF NEW FUNCTION-----Function InsertLifeLine(
Stepdate-,
> STep-, PN-, SN-, SO-, Pass-, Fail-, DrNumber- )'----------------'I added
a -
> to the end of each parameter name to prevent the table field name
being'the
> same'this function enters stuff into tblLifeLine'It will get call after
each
> get function '-----------------Dim StrInsertDim objConnInsertDim
> ObjRSInsertSet objConnInsert = Server.CreateObject("Adodb.Connection")Set
> ObjRSInsert = Server.CreateObject("Adodb.RecordSet")StrInsert = "INSERT
INTO
> tblLIFELINE ( Stepdate, STep, PN, SN, SO, Pass, Fail, DrNumber ) VALUES
> "StrInsert = StrInsert & "(#" Stepdate- & "#," & step- & "," & pn- & "," &
> sn- & "," StrInsert = StrInsert & so- & "," & pass- & "," & fail- & "," &
> DrNumber- & ");"Response.Write StrInsert & "
"ObjConnInsert.Open
> strConnObjRSInsert StrInsert, objConnInsert'Close and clean
> upObjRSInsert.CloseSEt objRSInsert = NothingObjConnInsert.CloseSEt
> objConnInsert = NothingEnd Function
>
>