埃德蒙顿华人社区-Edmonton China

 找回密码
 注册
查看: 3510|回复: 6

[请教] 一个计算机问题。

[复制链接]
鲜花(9) 鸡蛋(0)
发表于 2004-11-24 16:53 | 显示全部楼层 |阅读模式
用ASP做了一个主页,刚申请了一个空间,结果在我自己机器上好好的程序传上
0 u8 e" k- m5 @1 i) c9 P  y8 f1 R, S& c去后就不能用了,显示我的数据库连接有错误,我的语句是:
/ L* s6 a4 }, I+ X1 E
5 b+ p  h- Y" W6 {4 [+ l   dbc.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("databasename.mdb" )
: p1 Z# P. G( T8 h0 X$ N+ ?; @3 A
7 h) Z! p2 H* z. I5 K! h, q/ j5 X这有什么问题吗?为什么在我机器上好好的?是不是这个服务器不支持ACCESS# |" S, p5 f3 t# ^# f1 @
数据库?6 q6 b; c* W# Z$ j+ X$ f8 Y

7 I' M7 S' s8 }9 J3 L谢谢!
  u/ r/ v8 k6 m9 U. x3 s. @: S/ [8 }) B1 d
[ Last edited by 将腐败进行到底 on 2004-11-24 at 07:55 PM ]
鲜花(0) 鸡蛋(0)
发表于 2004-11-24 17:31 | 显示全部楼层
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"      
& M# g3 M' `2 U+ D2 Z' v        set conn=server.createobject("ADODB.CONNECTION")
: i( Y% g. ?* M, |        if err.number<>0 then
/ y% A7 X7 m3 C8 Y% I( U                err.clear/ C* k: n! j$ X+ Q# v7 a8 O
                set conn=nothing% K! p& ?" A" y/ U; d9 l, x3 ^
                response.write "数据库连接出错!"
. E+ T6 C1 H" g% a, B/ x                Response.End
7 H/ \! H, a" y2 K0 ~( s        else* O$ L* {8 @$ W) C5 H
                conn.open connstr& b8 \. c( U! `
                if err then ) w, P' v& L! D: K- G, t  m
                        err.clear
8 Q. E7 \3 }3 o                        set conn=nothing
( U) J+ c  H9 B                        response.write "数据库连接出错!"
$ |% N$ Y! ~' C/ |" n; q                        Response.End # O( u' ^" p% T/ m! m6 R! }+ w
                end if/ ~" G  t- a( A- I* f1 e" y9 W, l
        end if# W' @# Z! H8 u8 m. n$ e5 d; z  c1 O
看错了你的问题。有可能是你的server.mappath设置的问题。
0 h- `0 `' B1 A. L: `; w0 p& F/ f# m8 j" L5 m/ W8 [1 ]
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
大型搬家
鲜花(9) 鸡蛋(0)
 楼主| 发表于 2004-11-24 17:45 | 显示全部楼层
您的意思是:按照你的语句重新设置一下试试?
鲜花(240) 鸡蛋(0)
发表于 2004-11-24 18:24 | 显示全部楼层
不支持access
鲜花(9) 鸡蛋(0)
 楼主| 发表于 2004-11-24 18:30 | 显示全部楼层
错误信息是:
# b9 ?' o1 b9 R6 |4 Y9 i8 eADODB.Connection.1 error '800a0bb9'
! L. M. I) Z3 T5 d. G9 A! T& C
; U( x3 E" f, a( ^# U* z, QThe application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. % \7 P0 m2 w3 t5 _
: g' j8 g& T! e# J
我也觉得是不支持ACCESS,不过租前曾专门电话问过,说可以啊。
鲜花(0) 鸡蛋(0)
发表于 2004-11-24 18:51 | 显示全部楼层
那就是不支持了,数据库连接故障有很多种。
鲜花(2) 鸡蛋(0)
发表于 2004-11-24 19:42 | 显示全部楼层
应该是服务器端的ODBC没设置好。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系我们|小黑屋|手机版|Archiver|埃德蒙顿中文网

GMT-7, 2026-12-4 08:08 , Processed in 0.200498 second(s), 17 queries , Gzip On, APC On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表