ASP中的连接字符串 [英] Connection string in asp

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

问题描述

专家,


我有一个带mysql数据库的asp网站.

对于数据库连接,我已经使用 MySQL ODBC 5.1驱动程序
创建了odbc foodubai
在Mysql/odbc连接器向导中,我提到了以下描述.


数据源名称:foodubai
伺服器:mysql7.expogr.com
用户:foodubai
密码:1234

和数据库:foodubai

而我的数据库连接字符串是

Hi Expert,


I have one asp website with mysql database.

for database connection i have create odbc foodubai using MySQL ODBC 5.1 Driver

In Mysql/odbc Connector wizard i have mention following description.


Data Source name : foodubai
Server: mysql7.expogr.com
user: foodubai
password : 1234

and database : foodubai

and my database connection string is

Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open "Driver ={MySQL ODBC 5.1 Driver}; Server =mysql7.expogr.com; Option =16834; Database =foodubai; user=foodubai; password=1234"



但是上面的行显示了以下错误

用于ODBC驱动程序的Microsoft OLE DB提供程序(0x80004005)
[Microsoft] [ODBC驱动程序管理器]找不到数据源名称,也未指定默认驱动程序.


连接字符串有什么问题?.

预先表示感谢.



But above line shows following error

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.


what is the problem in connection string?.

Thanks in advance.

推荐答案

乍一看,问题可能出在以下其中一个:
1. 错误的连接字符串
确保您的连接字符串在所有方面都是正确的.用户名,
密码,ODBC名称.如果正确的话.转到下一步.

2. 正确的目标CPU
32位和64位版本的
有两种不同的ODBC驱动程序 操作系统.因此,请确保将应用程序编译为正确的版本.我
建议您将编译选项中的目标CPU更改为32位x86.

3. 正确设置ODBC
正如我所说的,对于32位和64位,有两种不同的ODBC驱动程序.
您可以在C:\ Windows \ SysWOW64 \ odbcad32.exe中找到32位ODBC管理器
和开始"-管理工具"-数据源"中的64位ODBC管理器.所以当
您正在设置ODBC,请使用适当的管理器进行设置.
如果您不确定要使用哪个管理员.无论您要做什么更改,
使用这两个ODBC管理器进行操作.

有关更多信息,请查看:
1. http://support.microsoft.com/kb/306345 [
From the first glance it seems that the problem can be one of the following :
1. Wrong connection string
Make sure that your connection string is correct in all aspects. User name,
Password, ODBC Name. If it is correct. Go to next step.

2. Correct Target CPU
There are two different ODBC drivers for both 32-bit and 64-bit versions of
OS. So make sure you are compiling you application to correct version. I
would suggest you to change the target CPU in compile options to x86 32 bit.

3. Correct ODBC set up
As I said there are two different ODBC drivers for 32 - bit and 64 - bit.
You can find the 32 - bit ODBC manager at C:\Windows\SysWOW64\odbcad32.exe
and 64 - bit ODBC manager at Start - Admin Tools - Data Sources. So when
you are setting the ODBC, do so at using appropriate manager.
If you are not sure which manager to use. Whatever changes you want to do,
do them using both these ODBC managers.

For further information check out :
1. http://support.microsoft.com/kb/306345[^]

Hope this helps.
All the best.


请参阅此处: http://connectionstrings.com/mysql [ ^ ]


连接字符串格式看起来不错,紧随其后是与MySQL ODBC驱动程序一起使用的连接字符串:

The connection string format looks ok, followiing is the connection string to be used with mySQL ODBC Driver:

Driver ={MySQL ODBC 5.1 Driver}; Server =localhost; Database =myDataBase; User =myUsername; Password =myPassword; Option =3;



检查以下链接以了解其他选项:

http://www.connectionstrings.com/mysql#p31 [ http://usefulscripts.wordpress.com/2007/10/11/mysql-asp-connection / [^ ]



check the following link for different options:

http://www.connectionstrings.com/mysql#p31[^]

also check this link for troubleshooting:

http://usefulscripts.wordpress.com/2007/10/11/mysql-asp-connection/[^]


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

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