A collection of errors at the beginning of the forum

Source: Internet
Author: User
Tags driver manager expression insert odbc ole
Error This 13 days, I am writing a forum, because just learn ASP time is not long, not to mention is and the first time to write a forum, encountered a lot of mistakes. In writing the forum, I have encountered some of the mistakes recorded

Recorded, want to post here, may be of some use to everyone.
1.
Error Tip:
Microsoft OLE DB Provider for ODBC Drivers error ' 80004005 '

[Microsoft] [ODBC Driver Manager] did not find a data source name and no default driver specified

/myforum/bbsconn.asp, line 4

When you check the check.asp this file in the nickname,
<!--#include file= "bbsconn.asp", with Ssi,ie prompted this error!
This error tip is refreshed three times before coming out, that is, if IE does not prompt errors, pay attention to refresh several times, perhaps the message came out.
Find the wrong, hehe, cool,)



2.
Below the source code posted out, let us see where I was wrong, this error, you notice it?
<% Dim Conn,dbpath
Set Conn=server. CreateObject ("Adodb.connection")
Dbpath=server. MapPath ("/myforum/bbs.mdb")
Conn.Open "Driver={microsoft Access Driver (*.mdb)};d bq=" &dbpath
%>
OK, everybody put the above source code and below this paragraph make a comparison, see can find out where is different? :) hehe
<% Dim Conn,dbpath
Set Conn=server. CreateObject ("Adodb.connection")
Dbpath=server. MapPath ("/myforum/bbs.mdb")
Conn.Open "Driver={microsoft Access Driver (*.mdb)};d bq=" &dbpath
%>
$%$#%^$^$%^& ^^ *&^&^%^#$$#######$$$[
I guess, not a few can find out, hehe, alas, these two words, everybody look carefully, {Microsoft Access Driver (*.mdb)}
and {Microsoft Access Driver (*.mdb)}
Do you see what's different?
The second sentence than the first sentence more than a space, behind the driver, hehe, because this space, I delayed two days, hehe,
However, the original depressed mood swept Ah, oh, the future will not make this mistake.
What do you think? How do you feel?


3
Microsoft VBScript Compiler error ' 800a0401 '

Statement not ended

/myforum/reg_submit.asp, line 14

Conn.execute "INSERT into users (Nickname,password,age,sex,province,schoolage,qq,email,vita,face) values

(' &nickname& ', ' &password& ', ' ' &age& ', ' ' &sex& ' ', ' ', ' ", '", ' ", '", " &schoolage& ', ' &QQ& ', ' ' &email& ', ' ' &vita& ' ', ' ' &face& ',

"+cstr (Mark)") "
--------------------------------------------------------------------------------------------------------------- --------------

--------------------------------------------------------------------------------------------------------------- -----^
Microsoft VBScript Compiler error ' 800a0401 '

Statement not ended

/myforum/reg_submit.asp, line 14


Oh, this problem is also the first encounter, but I am relatively easy to solve, there is no doubt that the CStr () a function, as long as the "+cstr ()" to "+cstr () +" on the line. a trifle.



4
ADODB. Recordset error ' 800A0CC1 '

The item was not found in the desired name or ordinal.

/myforum/baychoice.asp, line 47
The reason for this error is that an RS recordset is not established.




5
I found another little mistake today.
Conn.execute ' SELECT * from users where nickname= ' on ' bright '
Can you find out the mistake of this sentence?
This should be the right thing to do.
Conn.execute "SELECT * from Users where nickname= ' bright '"
In other words ("") double quotes inside can never be directly set double quotes.



6
There was another level which made me depressed by the mistake, alas
Microsoft OLE DB Provider for ODBC Drivers error ' 80040e07 '

[Microsoft] [ODBC Microsoft Access Driver] Standard expression does not match the data type.

/myforum/look.asp, line 8

The source code is as follows:
Dim rs_content,sql,articlenum
Articlenum=request ("num")
Session ("Articlenum") =articlenum
Set Rs_content=server. CreateObject ("Adodb.recordset")
Rs_content.open "SELECT * from Articlebay where articlenum= '" &articlenum& "", conn,3!!!!!!!!!!!!

!!!!!!!!!! 8th Line, change to
Rs_content.open "SELECT * from Articlebay where articlenum=articlenum", conn,3 just fine, depressed, why?



7
There is another mistake today, what is it?
Num=session ("Articlenum")

sql= INSERT INTO Revertbay (articlenum,revertauthor,reverttopic,revertcontent,expression,revertdate,reverttime) Values

("+cstr (num) +", "cat", "&topic&", "&content&" "," "&expression&", "&senddate&" , ' "&sendtime&") "
Error tip: Microsoft VBScript compiler error ' 800a0408 '

Invalid character

/myforum/replyok.asp, line 14
What is an invalid character? That is, the "cat" should be in single quotes. Alas



8
There are so many mistakes, and there are strange problems.
The source code is as follows:
<%
Sql= "INSERT into Articlebay (subbayname,author,topic,content,expression,articledate,articletime) VALUES ('" & subbayname& "', ' plus

Brown cat ', ' &topic& ', ' &content& ' ', ' ' &expression& ', ' ' &senddate& ', ' ', ' &sendtime & "')"
Conn.execute (SQL)

%>
The error prompts are as follows:
Microsoft OLE DB Provider for ODBC Drivers error ' 80040e14 '
[Microsoft] [ODBC Microsoft Access Driver] Syntax error



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.