| | |
dsn on other computer of the same lan
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2008
Posts: 20
Reputation:
Solved Threads: 0
Hi friend i use this code to connect via vb6 a mysql database in local.
Is possible to connect other pc with the same code on the dsn on original pc where reside the dsn?
Tks for all and sorry for my bad english i'm italian.
Sub uno()
Dim conn As ADODB.Connection, rec As ADODB.Recordset
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Dsn=test"
rec.Open ("select * from staff"), conn, adOpenStatic, adLockReadOnly
Debug.Print rec.Fields(0)
Debug.Print rec.Fields(1)
rec.Close
conn.Close
Set conn = Nothing
End Sub
note:
i know the ip od pc where is the dsn
Is possible to connect other pc with the same code on the dsn on original pc where reside the dsn?
Tks for all and sorry for my bad english i'm italian.
Sub uno()
Dim conn As ADODB.Connection, rec As ADODB.Recordset
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Dsn=test"
rec.Open ("select * from staff"), conn, adOpenStatic, adLockReadOnly
Debug.Print rec.Fields(0)
Debug.Print rec.Fields(1)
rec.Close
conn.Close
Set conn = Nothing
End Sub
note:
i know the ip od pc where is the dsn
•
•
Join Date: Jul 2009
Posts: 7
Reputation:
Solved Threads: 0
Hi there,
Try the followin to solve the problem..Let me know...
You can adopt this plan.
under control panel, ODBC, create a new DSN (data service Name) point to the access database, enter the user id and password.
and save it after naming it say Test.
use this code in the vb project;
Option Explicit
Dim conn As ADODB.Connection, rec As ADODB.Recordset
'under control panel_odbc create a DSn called Jinnie_test. point it to mdb file and enter user id and password
Private Sub Command1_Click()
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Dsn=test" ' test is the DSN Name.
rec.Open ("select * from testable2"), conn, adOpenStatic, adLockReadOnly
Text1 = rec.Fields(0)
Text2 = rec.Fields(1)
rec.Close
conn.Close
Set conn = Nothing
End Sub
Take Care..Buddy..
•
•
•
•
Hi friend i use this code to connect via vb6 a mysql database in local.
Is possible to connect other pc with the same code on the dsn on original pc where reside the dsn?
Tks for all and sorry for my bad english i'm italian.
Sub uno()
Dim conn As ADODB.Connection, rec As ADODB.Recordset
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Dsn=test"
rec.Open ("select * from staff"), conn, adOpenStatic, adLockReadOnly
Debug.Print rec.Fields(0)
Debug.Print rec.Fields(1)
rec.Close
conn.Close
Set conn = Nothing
End Sub
note:
i know the ip od pc where is the dsn
•
•
Join Date: Feb 2008
Posts: 20
Reputation:
Solved Threads: 0
•
•
•
•
Hi there,
Try the followin to solve the problem..Let me know...
You can adopt this plan.
under control panel, ODBC, create a new DSN (data service Name) point to the access database, enter the user id and password.
and save it after naming it say Test.
use this code in the vb project;
Option Explicit
Dim conn As ADODB.Connection, rec As ADODB.Recordset
'under control panel_odbc create a DSn called Jinnie_test. point it to mdb file and enter user id and password
Private Sub Command1_Click()
Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
conn.Open "Dsn=test" ' test is the DSN Name.
rec.Open ("select * from testable2"), conn, adOpenStatic, adLockReadOnly
Text1 = rec.Fields(0)
Text2 = rec.Fields(1)
rec.Close
conn.Close
Set conn = Nothing
End Sub
Take Care..Buddy..
But the dsn is on other computer not is located in the pc where i run the code(?!)....
How to the script know the ip/pc/ name where the dsn is saved?
•
•
Join Date: Mar 2009
Posts: 828
Reputation:
Solved Threads: 150
1st, if you need to, install the MySQL drivers on the other machine.
2nd, create the ODBC DSN on the other machine to point to your instance of MySQL.
3rd, create an install package with the PDW or Inno and instal program on other computer.
Or to answer your question more directly...
No you cannot have a program on another computer access your ODBC DSN. It needs to be created on the other computer.
Good Luck
2nd, create the ODBC DSN on the other machine to point to your instance of MySQL.
3rd, create an install package with the PDW or Inno and instal program on other computer.
Or to answer your question more directly...
No you cannot have a program on another computer access your ODBC DSN. It needs to be created on the other computer.
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- Remotely Access Local Computer (Windows Vista and Windows 7)
- connecting two computer with lan and switch (Networking Hardware Configuration)
- Process accessing another system within LAN (Visual Basic 4 / 5 / 6)
- Newbie Q:Wireless networked computer as LAN hub for internet (Networking Hardware Configuration)
- Moving a captured bitmap picture across a LAN nework (VB.NET)
- sending files over LAN thru C programs (C++)
- Computer won't start (Troubleshooting Dead Machines)
- Strange LAN/IP probs (Windows NT / 2000 / XP)
- Can't access website from LAN (Windows NT / 2000 / XP)
- xp remote desktop across wan/lan (Windows NT / 2000 / XP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: delete recordset
- Next Thread: Printing using Print dialog box
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





