用于访问 2000 DB 的 ASP VBScript 连接字符串

发布于 2024-12-01 13:36:27 字数 875 浏览 1 评论 0原文

我们有一个旧的 Access 2000 数据库,需要通过每 20 分钟运行一次的 Web 界面从中提取数据并将其存储到文本文件中。我花了几个小时寻找正确的连接字符串,但没有任何效果。

我什至使用了 Dreamweaver 的点击解决方案,并且能够让它通过本地计算机上的系统 DSN 连接并提取数据,但是当我将其上传到测试服务器(本地计算机和本地计算机)时,它显示 500 内部服务器错误和测试服务器系统 DSN 具有相同的名称)。 (为了向顽固的程序员澄清,我是一名开发人员,正在使用 Dreamweaver,因为我不知道我在用 ASP 做什么。)

我在测试服务器(win server 2008)上创建了一个系统 DSN,但它没有似乎有效。我不知道这是我编写的 VB 代码的问题还是 DSN 的问题。我可以得到一些帮助吗,我的截止日期是明天早上! (如果我没有按时完成,我们业务中的主要系统将无法工作!)

Dreamweaver Connection:

Dim MM_LocalDb_STRING
MM_LocalDb_STRING = "dsn=Db;"

Dim Students
Dim Students_cmd
Dim Students_numRows

Set Students_cmd = Server.CreateObject ("ADODB.Command")
Students_cmd.ActiveConnection = MM_LocalDb_STRING
Students_cmd.CommandText = "SELECT * FROM Students" 
Students_cmd.Prepared = true
Students = Students_cmd.Execute
Students_numRows = 0

我也见过各种连接字符串,并尝试过但没有成功。请帮忙! (先感谢您。)

We have an old Access 2000 database that we need to pull data from and store it into a text file via a web interface that has to run every 20 minutes. I have spent hours and hours searching for a correct connection string without anything working.

I even used Dreamweaver's point-and-click solution and was able to get it to connect and pull data with a System DSN on my local machine, but it shows a 500 Internal Server Error when I upload it to the testing server (both the local and the testing server System DSNs have the same name). (For clarification to die-hard programmers, I am a developer and am using Dreamweaver because I have no idea what I'm doing with ASP.)

I created a System DSN on the testing server (win server 2008), but it doesn't seem to work. I don't know if it's something with the VB code I'm writing or an issue with the DSNs. Could I please get some help with this, my deadline for this is tomorrow morning! (If I don't meet the deadline, major systems in our business will not work!)

Dreamweaver Connection:

Dim MM_LocalDb_STRING
MM_LocalDb_STRING = "dsn=Db;"

Dim Students
Dim Students_cmd
Dim Students_numRows

Set Students_cmd = Server.CreateObject ("ADODB.Command")
Students_cmd.ActiveConnection = MM_LocalDb_STRING
Students_cmd.CommandText = "SELECT * FROM Students" 
Students_cmd.Prepared = true
Students = Students_cmd.Execute
Students_numRows = 0

I have also seen various connection strings and have tried them with no success. Please help! (Thank you in advance.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你是年少的欢喜 2024-12-08 13:36:27

如果可以,请尝试在测试服务器上本地访问该页面。我相信这应该给你一个更具体的错误,而不仅仅是通用的 500。

我的想法是,因为这在你的开发机器上有效,所以这是一个权限错误。您应该确保 IUSR 和 LOCAL SERVICE 帐户对数据库文件具有读/写权限。

If you can, try accessing the page locally on the test server. I believe this should give you a more specific error than just the generic 500.

My thought, because this works on your dev machine, is that it's a permissions error. You should make sure that the IUSR and, I think, LOCAL SERVICE accounts have read/write permissions to the database file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文