-
There's nothing wrong with having variables as keywords. But you need to know if your variables are legitimate. I don't recommend that you execute sql directly, it's better to do an assignment operation. Easy to check.
In this position, you can output SQL variables to check if the variables in SQL are the values you want to get. Thus checking for errors. If IDTYPE or BoardDAT is a reserved word for VB, such as "name insert", you can wrap it in parentheses (if parentheses are not OK, single quotes.)''There are differences between databases.
set rs=
-
There is nothing wrong with the variable as a keyword, your mistake is that there should be spaces before and after the &, which is modified as follows:
insert into " & boarddata & " (topic,author,periodical,volume,indextype,beizhu,issuetime,dateandtime,provider,indexnumber,sci) values ('" & topic & "','" & author & "','" & periodical & "','" & volume & "','" & indextype & "','" & beizhu & "','" & issuetime & "','" & now() "','" & membername & "','" & indexnumber & "','" & sci & "')")
set rs="select top 1 " & idtype & " from " & boarddata & " order by " & idtype & " desc")
-
sql="select * from [cadb] where 1=1 "
if keywords<>"then
select case searchtype
case "bh"
sql=sql & and number like'%keywords &"
case "hm"
sql=sql & and username like'%keywords &"
case "zz"
sql=sql & and address like'%keywords &"
case "dw"
sql=sql & and unit like'%keywords &"
case "dh"
sql=sql & and ** like '%keywords &"
case "jfrq"
sql=sql & and payment date like'%keywords &"
case "jzrq"
sql=sql & and due date like'%keywords &"
end select
end if
sql=sql & order by [id] desc"
If the keywords are empty, they are correct, but if the keywords are not empty, there are no where and where conditions. So the error is reported.
Add where 1=1 at the end, and then you can save it with other conditional statements, and determine whether to add and id as database keywords, so be sure to add [id].
-
user, name, and password are all keywords, and they are all enclosed in square brackets.
user]name]
-
sql="select title,body,user_name,submit_date from bbs where"
sql=sql & " parent_id=" & bbs_idsql=sql & " order by submit_date desc"
Let's see if it's right to change the above three sentences to that – add a space to the second and third lines.
-
bbs_id=request("bbs_id") is modified to:
bbs_id=val(request("bbs_id"Below the above statement, add:
set rs="")
-
You just change it to.
Try again. It should be fine.
-
It's like: select * from information where [student ID] like "%."
-
You can print out the SQL statement and then read it.
At. sql,conn,1,1
Before, add.
SQL in. sql,conn,1,1
Before, add.
sqlsql,conn,1,1
It's good to analyze the error,
-
sql="select * from soft soft_catidsql="select * from soft soft_classid
sql="select * from SQL= above soft soft name"Select * from soft followed by a where.
-
The easiest way to test is to display kemu, tileixing, and strsql on the page to see if they are all correct.
Moreover, the parameters of the web page can only be obtained by passing, either in the form or in the url.
-
The easiest way.
Question type. strsql
Paste the output strsql value up.
Or just q me :21616898
-
The drop-down list variables of the same page cannot be obtained in asp, asp can only get the form variables submitted by the previous page, so your kemu variable is always empty.
-
For such a problem, you can set a breakpoint and debug it yourself. Because your ** is extremely restrictive, I can't help you debug. First of all, if you have the condition to remember the **space, you don't have this.
Second, I don't know if it's a database field name, if it is, then add a space after it and like. In addition, like and the following ones should also add spaces. I've made adjustments based on your **, you see, in order to show obviously, I added multiple spaces.
private void b5_click(object sender, eventargs e)
-
mm_ +=from join where id='"mm_'g, "Celery")
The name of your table is called"First rush join"?Then change it to:
mm_ +=from [join] where id='"mm_'g, "Slippery")
1 He instilled traditional Confucianism in us through easy-to-understand stories. >>>More
The data type given by the sno int primary key is int, and the data you give is character!
1 These are the products of Mattel and shipped in 1959.2 According to reports, Barbie sold more than 1 million units worldwide. >>>More
Debugging is an indispensable part of program development. "Three points of programming and seven points of debugging" means that the workload of program debugging is much larger than programming. Errors in C programs can be divided into two types: syntactic errors and logical errors. >>>More
It's not the same as programming.
1. Belonging to the National People's Congress. >>>More