msfrontpage中的sql连接字符串 [英] sql connection string in msfrontpage

查看:58
本文介绍了msfrontpage中的sql连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在msfrontpage中建立与sql的连接?

我已经做到了:

How do I establish a connection to sql in msfrontpage?

I have done this:

Dim Conn,objrs
Set Conn=server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider={SQL Server}; Data Source=dataserver;Initial Catalog=dbname; User ID=uid; Password=pswrd" 
Conn.open	
set objrs=Server.CreateObject("ADODB.Recordset")
strSQL="select field1 from table1"
objrs.open strSQL,Conn,3,3
response.write "test"


但显示错误:


but it shows an error:

Error Type:
ADODB.Connection (0x800A0E7A)
Provider cannot be found. It may not be properly installed.
/iss/example.asp, line 12


我该怎么办?


What should I do?

推荐答案

我在这里看到了几件事.首先,您尝试使用ADODB进行连接,但是使用的是OLEDB连接字符串.区别很重要.如果我没记错的话,您应该将OLEDB用于Frontpage/Classic ASP连接.我不确定这是因为它不支持ADO还是其他原因.无论如何,这里是一个站点,将为您提供有关如何连接到SQL数据库的示例:

http://www.4guysfromrolla.com/webtech/063099-1.shtml [ ^ ]

如果您想知道不同的SQL连接字符串,可以随时访问 http://www.connectionstrings.com/ [ ^ ].只要确保选择适合您的情况.
I see a couple things here. First, you are trying to use ADODB for your connection and yet you are using an OLEDB connection string. The difference is important. If I recall correctly, you should use OLEDB for Frontpage/Classic ASP connections. I''m not sure if it is because it doesn''t support ADO or if it was something else. In any event, here is a site that will give you an example of how to connect to a SQL database:

http://www.4guysfromrolla.com/webtech/063099-1.shtml[^]

If you are wondering about different SQL connection strings, you can always go to http://www.connectionstrings.com/[^]. Just make sure you pick the right one for your situation.


这篇关于msfrontpage中的sql连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆