|
According to the error message you posted, it should still be a problem with your database connection, not where it is written.Where you write it will only affect when you trigger this code, and there will be no error message.You put it in open The event is triggered when the window is opened. Written in itemchanged, it will not be triggered when no data is retrieved, because it is triggered when the item is changed. The correct data window retrieval method should besuperricheThe way the brother said it.
In addition, according to the error prompt you posted, you should use ODBC to connect to sql server. Personally I suggest you use the dedicated channel provided by PB with sql server, so that it is better in terms of speed and stability. I think there are three problems with your problem One possibility: one is the ODBC version. When I use ODBC to connect to Access, I will report some inexplicable errors. The problem is the ODBC version. The second may be a problem with the writing of your data window. Check your data window. SQL. The third problem is your driver. I have attached the driver code for the connection with the UFIDA server below. The environment is pb6.5 and sql server2000.
// Profile lwz_test
SQLCA.DBMS = "MSS Microsoft SQL Server 6.x"
SQLCA.Database = "UFDATA_005_2006"
SQLCA.ServerName = "10.0.2.10"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = "CommitOnDisconnect = 'No'" |
|