# Re: ODBC & SQL SERVER

Posted by Lisa Chang on November 30, 1997 at 18:19:56:

In Reply to: ODBC & SQL SERVER posted by 小立 on November 29, 1997 at 01:50:01:

: 我安装了NT4.0 SERVER跟SQL SERVER 6.5，
: 在WINDOWS 95上要怎样设置ODBC或其他才能让vb6.0企业版
: 使用SQL SERVER6.5？
采DSN方式:
1.到Win95控制台的ODBC设定DSN=sqlodbc的资料来源
2.在vb
Set Pen = rdoEnvironments(0)
Pconnect ="UID=mm;PWD=kk;DATABASE=uu;DSN=sqlodbc;"
Set Pdb = Pen.OpenConnection(dsname:="", _ Prompt:=rdDriverNoPrompt, Connect:=Pconnect)
采没有DSN方式:
Set Pen = rdoEnvironments(0)
Pconnect="UID=mm;PWD=kk;Server=cc;Database=uu;" & _
"DRIVER={SQL SERVER};"
Set Pdb = Pen.OpenConnection(dsname:="", _ Prompt:=rdDriverNoPrompt, Connect:=Pconnect)

Follow Ups: