Sahil
Thu May 26 03:47:11 CDT 2005
Sorry, but I gotta agree with Mark on this - we'd love to help, but not do
your job for you :-)
Anyway, Mark is right, you have to learn VB.NET and ADO.NET to convert this
code.
See you can't see heaven without dying yourself, so you've gotta learn .NET.
- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
"Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%23GvVjnbYFHA.3572@TK2MSFTNGP12.phx.gbl...
> "sam" <samuellai@ajikl.com.my> wrote in message
> news:e5pY1daYFHA.3864@TK2MSFTNGP10.phx.gbl...
>
>> How do I convert this ASP 3.0 to VB.Net coding?
>
> You're surely not expecting someone to write your code for you, are
> you...?
>
> 1) Create a stored procedure to fetch the records from F4111
>
> 2) Create a parameterised stored procedure to insert new records into
> F4111A
>
> 3) Fetch the records from F4111 into an SqlDataReader
>
> 4) Loop through the SqlDataReader and add the records to F4111A using the
> ExecuteNonQuery method calling the parameterised stored procedure.
>
> Alternatively, your code below appears to be copying the entire contents
> of F4111 into F4111A - why not just write a stored procedure to do the
> whole thing in one go?
>
>>
>>
>> ASP 3.0 Coding
>> -----------------
>> Set rs = Server.CreateObject("ADODB.Recordset")
>> rsstatm = "SELECT * FROM F4111"
>> rs.Open rsstatm, ConnSQL
>>
>> rs.movefirst
>>
>> do while not rs.eof
>>
>> rsAdd = "INSERT INTO F4111A (ILITM,ILLITM,ILAITM) VALUES"
>>
>> rsAdd = rsAdd & "( " & rs("ILITM")&","
>> rsAdd = rsAdd & "'" & rs("ILLITM") &"',"
>> rsAdd = rsAdd & "'" & rs("ILAITM") &"' )"
>>
>> ConnSQL.Execute(rsAdd)
>> Set rsAdd = Nothing
>>
>> rs.movenext
>> loop
>>
>> rs.close
>> Set rs = Nothing
>> Set rsstatm = Nothing
>>
>> Please help.
>>
>> Many thanks.
>>
>
>