Re: about insert data....

From: Al Reid (areidjr_at_reidDASHhome.com)
Date: 08/06/04


Date: Fri, 6 Aug 2004 08:11:26 -0400


"Bobby" <bobby.saputra@epselindo.com> wrote in message news:ORB4Iu6eEHA.2044@TK2MSFTNGP10.phx.gbl...
> Thanks for your quick responce, Can you give me an example please?
>
> thanks
>

Since you did not supply the database you are using I will supply an example using dynamic SQL. I also included only the first
three fields. I assume that the three fields are string data. The strings are surrounded by apostrophes. You would omit the
apostrophes for numeric data. Date handling is database dependent. So here it is:

   strSql = "INSERT INTO forest " & _
            "(fld1, fld2, fld3) " & _
            "VALUES('" & UCase(SLNO) & "', '" & UCase(empcode) & "', '" & UCase(Name) & "')"

   FCON.Execute strSql, , adExecuteNoRecords

You get the picture. You can now replace fild1-fld3 with the correct field names and add the remaining fields to the SQL statement.

I hope this helps.

-- 
Al Reid
How will I know when I get there...
If I don't know where I'm going?


Relevant Pages

  • Dynamic SQL in Stored Proc
    ... I have a database setup so that NO users have READ, ... Dynamic SQL and they have stopped working. ... error message when executing one of the stored procs. ...
    (microsoft.public.sqlserver.security)
  • Re: SQL Injection Prevention
    ... I was pointing that you're not considering it in isolation but with the ... I think it's much more likely that an application developer would build the ... sql string from input that the database developer would do it in dynamic sql. ...
    (microsoft.public.sqlserver.server)
  • Re: SQL Injection Prevention
    ... I was pointing that you're not considering it in isolation but with the ... I think it's much more likely that an application developer would build the ... sql string from input that the database developer would do it in dynamic sql. ...
    (microsoft.public.dotnet.security)
  • Re: ASP coding help required please
    ... Your database will not know anything about the Request object. ... sType = Request.Form ... sAcct = Request.Form ... Avoid the dynamic sql approach, but if you are determined to use it, see: ...
    (microsoft.public.inetserver.asp.db)
  • Re: SQL Injection and DB user permissions
    ... since it contains quite a bit of 'dynamic sql' and I KNOW ... that employing a database user in the connection string with ... The only potential problem ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)