JDL129
asked on
Connection string from vb6 to sqlServer 2005 express
I need a connection string from vb6 to sqlserver 2005 express:
CAKPOSSERVER\SQLEXPRESS,
Database = "Barcode"
User = "POSiTrack"
PWD = "Fire4635"
Please no links!!
Thanks,
Jerry
CAKPOSSERVER\SQLEXPRESS,
Database = "Barcode"
User = "POSiTrack"
PWD = "Fire4635"
Please no links!!
Thanks,
Jerry
ASKER
RajkumarGS!!!!
How would I use this?
Thanks,
Jerry
How would I use this?
Thanks,
Jerry
check here
http://msdn.microsoft.com/en-us/library/bb264566(SQL.90).aspx
Dim cn As ADODB.Connection
Set cn = New Connection
cn.ConnectionString = "Provider=SQLNCLI.1;Integr ated Security=SSPI;" & _
"Persist Security Info=False;" & _
"AttachDBFileName=" & App.Path & "\northwnd.mdf;Data Source=server1\sqlexpress"
cn.Open
http://msdn.microsoft.com/en-us/library/bb264566(SQL.90).aspx
Dim cn As ADODB.Connection
Set cn = New Connection
cn.ConnectionString = "Provider=SQLNCLI.1;Integr
"Persist Security Info=False;" & _
"AttachDBFileName=" & App.Path & "\northwnd.mdf;Data Source=server1\sqlexpress"
cn.Open
also try this
adoConn.Open "PROVIDER=MSDataShape;Data Provider=SQLNCLI.1;Persist Security Info=0;User ID=UserName;Password=Passw ord;Initia l Catalog=DatabaseName;Data Source=servername"
adoConn.Open "PROVIDER=MSDataShape;Data
ASKER
HainKurt!!!!
I've tried both of these and I keep getting "Object or with block not set"
Dim db As ADODB.Connection
db.ConnectionString = "Provider=SQLNCLI.1;Integr ated Security=SSPI;" & _
"Persist Security Info=False;" & _
"AttachDBFileName=CAKPOSSE RVER\C\PRO GRAM FILES\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ BARCODE.MD F;Data Source=CAKPOSSERVER\sqlexp ress"
db.Open
db.Open "PROVIDER=MSDataShape;Data Provider=SQLNCLI.1;Persist Security Info=0;User ID=POSiTrack;Password=Fire 4635;Initi al Catalog=Barcode;Data Source=CAKPOSSERVER\SQLEXP RESS"
What am I missing?
Thanks!!!!
Jerry
I've tried both of these and I keep getting "Object or with block not set"
Dim db As ADODB.Connection
db.ConnectionString = "Provider=SQLNCLI.1;Integr
"Persist Security Info=False;" & _
"AttachDBFileName=CAKPOSSE
db.Open
db.Open "PROVIDER=MSDataShape;Data
What am I missing?
Thanks!!!!
Jerry
you are missing this
Set cn = New ADODB.Connection
Set cn = New ADODB.Connection
check 28303147 to see how it is defined, set and used...
ASKER
HainKurt!!
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Set db = New ADODB.Connection
db.Open "PROVIDER=MSDataShape;Data Provider=SQLNCLI.1;Persist Security Info=0;User ID=POSiTrack;Password=Fire 4635;Initi al Catalog=Barcode;Data Source=CAKPOSSERVER\SQLEXP RESS"
It appears that the database opens but the error I get now is "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another" Origianlly this was connected to an Access database and I'd like to connect to the sql server in a way the opening a recordset in sqlserver is not much different from opening it in Access if that's possible.
Set rs = db.OpenRecordset("tblCompa ny", dbOpenSnapshot)
If rs!INTERFACE = "NONE" Then
gblnInterface = False
ElseIf rs!INTERFACE = "PSI" Then
gblnInterface = True
End If
Thanks for your help!!!!
Jerry
Dim db As ADODB.Connection
Dim rs As ADODB.Recordset
Set db = New ADODB.Connection
db.Open "PROVIDER=MSDataShape;Data
It appears that the database opens but the error I get now is "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another" Origianlly this was connected to an Access database and I'd like to connect to the sql server in a way the opening a recordset in sqlserver is not much different from opening it in Access if that's possible.
Set rs = db.OpenRecordset("tblCompa
If rs!INTERFACE = "NONE" Then
gblnInterface = False
ElseIf rs!INTERFACE = "PSI" Then
gblnInterface = True
End If
Thanks for your help!!!!
Jerry
on which line do you get thuis error?
check here
http://www.w3schools.com/ado/met_rs_open.asp
Set rs = db.OpenRecordset("tblCompa ny", dbOpenSnapshot)
-->
Set rs = db.OpenRecordset ("tblCompany")
http://www.w3schools.com/ado/met_rs_open.asp
Set rs = db.OpenRecordset("tblCompa
-->
Set rs = db.OpenRecordset ("tblCompany")
also change these lines
If rs!INTERFACE = "NONE" Then
gblnInterface = False
ElseIf rs!INTERFACE = "PSI" Then
gblnInterface = True
End If
-->
if not rs.EOF Then
gblnInterface = ( rs("INTERFACE") = "PSI" )
End if
If rs!INTERFACE = "NONE" Then
gblnInterface = False
ElseIf rs!INTERFACE = "PSI" Then
gblnInterface = True
End If
-->
if not rs.EOF Then
gblnInterface = ( rs("INTERFACE") = "PSI" )
End if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great job!! Thanks for your help
Provider=SQLOLEDB.1;Data Source =CAKPOSSERVER\SQLEXPRESS;I
Raj