odbc连接sql2000的问题,求教高手

shanghaichenbo 2004-10-22 01:48:56
以下是程序代码:
Public goWorkSpace As Workspace
Public gobjServer As Object
Private lqryrltMyset As Recordset

Set goWorkSpace = CreateWorkspace("", "asahi", "asahi", dbUseODBC)
Set gobjServer = goWorkSpace.OpenConnection("", dbDriverNoPrompt, False, "ODBC;Driver=SQL Server;server=" & hsServer & ";UID=" & hsLogin & ";PWD=" & hsPassword & ";DATABASE="&hsDBName)

sql1="select * from A where temp1=0 And temp2 is not null"
Set lqryrltMyset = gobjServer.OpenRecordset(sq1, dbOpenSnapshot)

sql2="select A.*,b.b2,c.c2 from A,B,C where A.a1=B.b1 and A.a1=C.c1"
Set lqryrltMyset = gobjServer.OpenRecordset(sq2, dbOpenSnapshot)

运行sq1正确,运行sq2出错(注:sql1,sql2在sql2000的工具中运行都是对的)
为什麽?郁闷中....,求教高手,急,急...
...全文
65 点赞 收藏 2
写回复
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
shanghaichenbo 2004-10-22
odbc连接出错
回复
GGL123 2004-10-22
出错提示是什么?
回复
发动态
发帖子

1180

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
社区公告
暂无公告