Microsoft
Software
Hardware
Network
Question : Connect a VB6 Client App to a remote SQL Server 2005 database using ADO 2.8
I have built a client application in VB6 using an MS Access database with ADO 2.8 connection strings and subsequent recordsets. My client wants this on a remote SQL Server 2005 database hosted at GoDaddy.com. I've set up the database using SQL Server Migration Assistant with no problems. Now I need to re-code my software to access the SQL instead of the Access db. Someone please get me headed in the right direction! I've included an sampling of the current code. I'd like to keep things as simple as possible using code only (no data "widgets")
Private Sub examplecode()
Public dbPath As String
Public dbConn As String
Public sqlstring As String
Public cnTime As Connection
Public rsEmp As Recordset
dbConn = "Provider=Microsoft.Jet.OL
EDB.4.0;Da
ta Source="
dbPath = "C:\StaffTime.mdb"
sqlstring = "SELECT * FROM Emp"
Set conn = New Connection
Set rsEmp = New Recordset
conn.Open dbConn & dbPath
rsEmp.Open sqlstring, conn, adOpenDynamic, adLockOptimistic, adCmdText
With rsEmp
While Not .EOF
'perform add, update
'delete, view procedures
.MoveNext
Wend
End With
rsEmp.Close
conn.Close
End Sub
Answer : Connect a VB6 Client App to a remote SQL Server 2005 database using ADO 2.8
try changing the conn.Open statement to
conn.Open "Data Source=remoteServerAddress
;Initial Catalog=DataBaseName;User Id=remoteUsername;Password
=remotePas
sword;"
Random Solutions
Make a selection based on age calculated from birth date
PowerShell SFTP
3 join question
Filter blocks of data in excel
An autocomplete property / method for textbox?
How do I setup "completely" Unsolicited Remote Assistance Requests in Windows 7 for remote support? - Replacing free VNC
free whole disk encryption software, wich is the best?
E-Machines EL1200 BSOD at Startup - Windows XP SP2
Disk 1 Unreadable
text wont appear in word 2007