ASP不能寫入SQL資料庫,報錯

2022-06-30 11:30:23 字數 2001 閱讀 5091

1樓:匿名使用者

更新,不是value,是values,

倒下。。

有錯。。。

自己修改自己答案:

sql="insert into [example3]

(name,tel,message)

寫成

(name,tel,message) &_

幾點供參考:

1.把ie高階設定中的「顯示http友好錯誤資訊」的鉤去掉。這樣可以看到錯誤內容。

2.conn保證沒有問題?先來個簡單的select測試吧。

3.如果是寫到access的話可能會有許可權問題。即你的access檔案如果在c盤,而c盤不允許這樣操作的話,也會不提示出錯。

4.如果寫入到sql的話,〔example3〕這個表是否有主約束,或者不允許為空,這樣也會導致插入失敗。可以先在查詢分析器直接跑insert語句測試。

-------------

2樓:匿名使用者

乍看上去,就發現:

sql="insert into [example3](name,tel,message)

後面少了一個單引號,而且message前後沒有加字串連線執行符,應該是

sql="insert into [example3](name,tel,message)

具體還要看報錯資訊呢

conn.execute(sql)直接這樣寫好像也會報錯。

可以改為

conn.execute sql

或者call conn.execute(sql)

3樓:

<%dim name,tel,message

name=request.form("name")tel=request.form("tel")message=request.

form("message")sql="insert into [example3] (name,tel,message)

conn.execute(sql)

conn.close

response.write "記錄新增成功!"

%>鬱悶 sql= 那一行 和下面是同一行

asp寫入sqll資料庫時提示:'在此環境中不允許操作'怎麼解決?

4樓:匿名使用者

可能是你開啟記錄集是用了錯誤的方式

rs.open sql,conn,1,3

後面那個一定要用3

5樓:弦上毛蟲的文具店

on error resume next

註釋掉試試,看看報什麼錯誤

你是不是有哪個欄位不允許為空的,而你有沒有給他值

請問一下win7的asp寫資料入資料庫時就出錯,讀資料時就可以,請問為什麼?

6樓:匿名使用者

寫出錯,是不是資料庫目錄沒有internet使用者寫的許可權?或者ntfs格式硬碟上該目錄沒有everyone寫許可權?

asp無法寫入sql資料庫,急!!

7樓:匿名使用者

rs.open sql,conn,1,3

conn_vip.close

set conn_vip=nothing

你的資料庫連結字元是定義的conn嗎

sql怎樣跨資料庫查詢,sql怎樣跨資料庫查詢oracle

使用dblink。例如 當前使用的資料庫是orcl1 要查詢的資料庫是orcl2的scott使用者的表。create public database link orcl2 scott connect to scott identified by tiger using description add...

sql資料庫連線不上,SQL資料庫連線不上

sql server 無法啟動並顯示錯誤 18456 症狀sql server 服務無法啟動,同時您可能會在 windows 事件檢視器中看到以下錯誤資訊 sqlserveragent could not be started reason unable to connect to server s...

sql資料庫問題

select from dbo.sys object where id in select id from sys column where column name c checkturn 似乎是這麼查,具體的欄位可能有出入!表名從 sys object表來,欄位從 sys column表來。通過查...