Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ASP / SQL Error

[code]
<%
IF Request.Form("Posted") = "YES" Then
Dim strSQL, strConnect, objConn
strSQL = Request.Form("SQL")
strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
objConn.Execute SQL
Else
%>


Custom SQL Execution



SQL:



image
image
image


<%
End IF
%>
[/code]

Umm.. Ok

If I post these values to the page, I get an error...

Posted: YES
SQL: DROP TABLE tblMembers


I KNOW FOR A FACT THAT tblMembers EXISTS!
I ALSO KNOW FOR A FACT Members.mdb EXISTS

Can anyone tell me whats going on here?



-( Aaron )-

Peace all...

Comments

  • FlakesFlakes Member Posts: 642
    : [code]
    : <%
    : IF Request.Form("Posted") = "YES" Then
    : Dim strSQL, strConnect, objConn
    : strSQL = Request.Form("SQL")
    : strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
    : Set objConn = Server.CreateObject("ADODB.Connection")
    : objConn.Open strConnect
    : objConn.Execute SQL
    : Else
    : %>
    :
    :
    : Custom SQL Execution
    :
    :
    :
    :
    :
    :
    :
    : : : :
    : : :
    SQL:
    :
    :
    :

    : image
    : image
    : image
    :
    :
    :
    :
    : <%
    : End IF
    : %>
    : [/code]
    :
    : Umm.. Ok
    :
    : If I post these values to the page, I get an error...
    :
    : Posted: YES
    : SQL: DROP TABLE tblMembers
    :
    :
    : I KNOW FOR A FACT THAT tblMembers EXISTS!
    : I ALSO KNOW FOR A FACT Members.mdb EXISTS
    :
    : Can anyone tell me whats going on here?
    :
    :
    :
    : -( Aaron )-
    :
    : Peace all...
    :


    [code]
    <%
    IF Request.Form("Posted") = "YES" Then
    Dim strSQL, strConnect, objConn
    strSQL = Request.Form("SQL")
    Response.write "Debug:strSQL= "& strSQL &"<BR/>"
    strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open strConnect
    objConn.Execute [red]strSQL[/red]
    Else
    %>

    [/code]
  • aaronjones3593aaronjones3593 Member Posts: 122
    : : [code]
    : : <%
    : : IF Request.Form("Posted") = "YES" Then
    : : Dim strSQL, strConnect, objConn
    : : strSQL = Request.Form("SQL")
    : : strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
    : : Set objConn = Server.CreateObject("ADODB.Connection")
    : : objConn.Open strConnect
    : : objConn.Execute SQL
    : : Else
    : : %>
    : :
    : :
    : : Custom SQL Execution
    : :
    : :
    : :
    : :
    : :
    : :
    : :
    : : : : : : : :
    : : : : : :
    SQL:
    : :
    : :
    : :

    : : image
    : : image
    : : image
    : :
    : :
    : :
    : :
    : : <%
    : : End IF
    : : %>
    : : [/code]
    : :
    : : Umm.. Ok
    : :
    : : If I post these values to the page, I get an error...
    : :
    : : Posted: YES
    : : SQL: DROP TABLE tblMembers
    : :
    : :
    : : I KNOW FOR A FACT THAT tblMembers EXISTS!
    : : I ALSO KNOW FOR A FACT Members.mdb EXISTS
    : :
    : : Can anyone tell me whats going on here?
    : :
    : :
    : :
    : : -( Aaron )-
    : :
    : : Peace all...
    : :
    :
    :
    : [code]
    : <%
    : IF Request.Form("Posted") = "YES" Then
    : Dim strSQL, strConnect, objConn
    : strSQL = Request.Form("SQL")
    : Response.write "Debug:strSQL= "& strSQL &"<BR/>"
    : strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
    : Set objConn = Server.CreateObject("ADODB.Connection")
    : objConn.Open strConnect
    : objConn.Execute [red]strSQL[/red]
    : Else
    : %>
    :
    : [/code]
    :
    Oh yes, silly me.

    It cant go ahead and execute NULL can it?

    Sorry, stupid mistake..

    -( Aaron )-

    Peace all...

Sign In or Register to comment.