ASP 需要对象:'服务器
ASP Object required: 'Server
我尝试在 visual studio 2012 年使用 asp Web 应用程序处理 http get 并将获取数据插入到我的 oledb 数据库中。
我创建了一个 html 项,并将扩展名从 html 更改为 asp。
这是我的代码:
<%
'declare the variables
Dim Connection
Dim Recordset
Dim SQL
Dim objRS
Dim objConn
Dim strConnect
'Option Explicit
Dim nome, ID
nome = Request.Querystring("Name")
ID = Request.Querystring("Id")
'declare the SQL statemant that will query the db
SQL = "INSERT INTO tablename (NomeFileNotifica, IDErrore, ISNew) VALUES ('"+nome+"', "+ ID +", 1)"
StrConnect = "PROVIDER=MICROSOFT.JET.OLEDB.4.0; Data Source = ***; Database = dbname; User ID = username; Password=password;"
Set objConn = Server.CreateObject(ADODB.Connection)
objConn.Open "tablename" , strConnect
Set objRS = Server.CreateObject(ADODB.Recordset)
objRS.Open SQL, objConn, 0 ,1
' .. More processing of the other variables .. '
'Processing / validation done... '
Response.Write nome & vbCrLf
Response.Write ID & vbCrLf
%>
Get 处理程序运行良好,但如果我尝试连接到我的数据库,则会出现以下错误
Object required: 'Server
在这一行:
Set objConn = Server.CreateObject(ADODB.Connection)
所有 ASP 脚本都在 HTML 页面的正文中..
我在互联网上找不到任何解决方案,而且我在 ASP 方面也没有太多经验。有人可以帮助我吗?
谢谢
我发现了错误。
我忘记了 ADODB.Connection
周围的引号
Set objConn = Server.CreateObject("ADODB.Connection")
我尝试在 visual studio 2012 年使用 asp Web 应用程序处理 http get 并将获取数据插入到我的 oledb 数据库中。 我创建了一个 html 项,并将扩展名从 html 更改为 asp。
这是我的代码:
<%
'declare the variables
Dim Connection
Dim Recordset
Dim SQL
Dim objRS
Dim objConn
Dim strConnect
'Option Explicit
Dim nome, ID
nome = Request.Querystring("Name")
ID = Request.Querystring("Id")
'declare the SQL statemant that will query the db
SQL = "INSERT INTO tablename (NomeFileNotifica, IDErrore, ISNew) VALUES ('"+nome+"', "+ ID +", 1)"
StrConnect = "PROVIDER=MICROSOFT.JET.OLEDB.4.0; Data Source = ***; Database = dbname; User ID = username; Password=password;"
Set objConn = Server.CreateObject(ADODB.Connection)
objConn.Open "tablename" , strConnect
Set objRS = Server.CreateObject(ADODB.Recordset)
objRS.Open SQL, objConn, 0 ,1
' .. More processing of the other variables .. '
'Processing / validation done... '
Response.Write nome & vbCrLf
Response.Write ID & vbCrLf
%>
Get 处理程序运行良好,但如果我尝试连接到我的数据库,则会出现以下错误
Object required: 'Server
在这一行:
Set objConn = Server.CreateObject(ADODB.Connection)
所有 ASP 脚本都在 HTML 页面的正文中.. 我在互联网上找不到任何解决方案,而且我在 ASP 方面也没有太多经验。有人可以帮助我吗? 谢谢
我发现了错误。
我忘记了 ADODB.Connection
周围的引号 Set objConn = Server.CreateObject("ADODB.Connection")