Posting again: vb6 under XP ADO2.8, no response under Windows 7
Time:09-27
Originally posted at: http://bbs.csdn.net/topics/390804433 I use VB6 under XP system, reference ADO2.8, wrote a link SQL2000 code, under the XP running without any problems, but must wait 30 seconds under the Windows 7 there will be, in the meantime, shown on the program interface is no response, the system is a new outfit, Windows 7 64 - bit and 32-bit version is always the same, then there is a very strange thing, I put the program in the same virtual machine installed Windows 7 is very normal, who have also come across this problem??? Help! The code is as follows: Public cn As New ADODB. Connection Public Rs As New ADODB. You
Private Sub Command1_Click () On Error GoTo err_1 Cn. The ConnectionString="driver={SQL Server}; Server=0.0.0.0, port number; Uid=; The PWD=; The database=* * "
Cn. Open Cn. The Execute (" select * from czry ") Cn. Close
Err_1: If Err. Number=0 Then MsgBox "OK" The Else MsgBox "Error" End the If End Sub
Private Sub Command2_Click () Adodc1. The ConnectionString="Provider=sqloledb; The Data Source=0.0.0.0, port number; Network Library=DBMSSOCN; Initial Catalog=* *; User ID=; Password=;" Adodc1. RecordSource="select * from CGD" Adodc1. Refresh The Set DataGrid1. The DataSource=Adodc1 DataGrid1. Refresh End Sub
According to tip zhao4zhong1 wrote an alias, procedure when running normally, but after I put the computer operating system reinstall, also wrote an alias, ODBC, but useless, or the same as the original
CodePudding user response:
In a 64 - bit Windows: 64 exe and DLL in the directory c: \ Windows \ sys tem32 directory. 32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
Configuration of 32 bit DSN and alias to use C: \ Windows \ syswow64 \ odbcad32 exe C: \ Windows \ syswow64 \ cliconfg exe
CodePudding user response:
cn. The ConnectionString="driver={SQL Server}; Server=alias; Uid=database user name; The PWD=database user login password; The database the default database name="
CodePudding user response:
The cn in your code. The ConnectionString is made, yao, don't change the ha!