She has A problem, there is A native database A, A database to store some configuration information, login information, there will be A server database B, is used for storing data,
Now I landed connections are the local database. A, more relevant information distribution business module, there is A program needs to make data from A database B, C modified B saved back to the database, how to do it, please? Have a reference for the code,
PS: I can't move A library related tables to B in the library, please help to solve it,
CodePudding user response:
Is to define two connection transaction object (the transaction), and then set respectively, respectively, to connect, is ok,
CodePudding user response:
reference 1st floor lovemoreh response: is to define two connection transaction object (the transaction), and then set respectively, respectively, to connect,, Specific point ah, specific points, The code. CodePudding user response:
This is the default pb//Profile sqlca a global transaction object The SQLCA. DBMS="ADO.Net" The SQLCA. LogPass="admin" The SQLCA. LogId="sa" The SQLCA. The AutoCommit=False The SQLCA. DBParm="Namespace='System. The Data. SqlClient', the DataSource='TM - FEBD7A033E7A \ GSQL, Database=' master, '" The connect. If the sqlca. Sqlcode=1 then Messagebox (" error ", "the db connect a faild!" , StopSign!) The halt End the if //Profile sqlca_b could this in pb global variable definition the transcation sqlca_b SQLCA_b. DBMS="ADO.Net" SQLCA_b. LogPass="admin" SQLCA_b. LogId="sa" SQLCA_b. The AutoCommit=False SQLCA_b. DBParm="Namespace='System. The Data. SqlClient', the DataSource='TM - FEBD7A033E7A \ GSQL, Database=B" Connect using SQLCA_b;//if it is not the default transaction object, must develop, with the using after writing SQL must pay attention toIf sqlca_b. Sqlcode=1 then Messagebox (" error ", "connect db b faild!" , StopSign!) The halt end if CodePudding user response:
reference xys_777 reply: 3/f //Profile sqlca this is the default pb a global transaction object The SQLCA. DBMS="ADO.Net" The SQLCA. LogPass="admin" The SQLCA. LogId="sa" The SQLCA. The AutoCommit=False SQLCA. DBParm="Namespace='System. The Data. SqlClient', the DataSource='TM - FEBD... In SQLCA_b DBMS="ADO.Net" this step prompt error, when no object reference, I use ODBC links, namely SQLCA_b. DBMS="ODBC", the server is not on the CodePudding user response:
What is the use of a database CodePudding user response:
reference 5 floor liubocy reply: what use database Your holy leader as well, 1000 HP, 50 AD? SQL sever 2000 CodePudding user response:
refer to 6th floor yf52393975 response: your holy dragon like good, 1000 HP, 50 AD? SQL sever 2000 Ha ha, yes oh, With the following two things are two databases, turn off the influence of the remote connection things such as the firewall The SQLCA. DBMS="MSS Microsoft SQL Server 6. X" The SQLCA. Database="Database name" The SQLCA. ServerName="IP database" The SQLCA. LogId="sa" The SQLCA. The AutoCommit=false The SQLCA. DBParm="" The Connect. IF the Sqlca. SqlCode & lt;> 0 THEN MessageBox (', 'connection' + Sqlca SqlErrText) RETURN END the IF //Profile sqlca_b could this in pb global variable definition the transcation sqlca_b Sqlca_b. DBMS="MSS Microsoft SQL Server 6. X" Sqlca_b. Database="Database name" Sqlca_b. ServerName="IP database" Sqlca_b. LogId="sa" Sqlca_b. The AutoCommit=false Sqlca_b. DBParm="" Connect Using sqlca_b; IF sqlca_b. SqlCode & lt;> 0 THEN MessageBox (', 'connection' + sqlca_b SqlErrText) RETURN END the IF CodePudding user response:
refer to 7th floor liubocy response: refer to 6th floor yf52393975 response: Your holy leader as well, 1000 HP, 50 AD? SQL sever 2000 Ha ha, yes oh, With the following two things are two databases, turn off the influence of the remote connection things such as the firewall The SQLCA. DBMS="MSS Microsoft SQL Server 6. X" The SQLCA. Database="Database name" The SQLCA. ServerNam... I there is no MSS Microsoft SQL Server 6. X So I didn't use odbc CodePudding user response:
3 # is correct, I am not connected to the beginning, because I didn't create the data channels, which is not written sqlca_b=create transaction This sentence, so wrong, Now there is a another problem is that I run in the pb 10 frame appeared after the program, exit the program, again run frame, are unable to connect to the database, this could be the reason why? Connection failure: SQLState: '01000' SQL server error: '10093' CodePudding user response:
Under the roof, to ask, what does not disconnect?? I've just two transaction, 2 ds, CodePudding user response:
Thinking is actually a Transaction object variables, as to use the Create the variable I have already can't remember, you are in the help check Transaction class related information, and then, by defining the variables you can use it like using the SQLCA, but in the use process need to display use using keywords, or use the default SQLCA Transaction object, CodePudding user response:
references 9 f yf52393975 response: 3 # is correct, I am not connected to the beginning, because I didn't create a data channel, also is not write sqlca_b=create transaction This sentence, so wrong, Now there is a another problem is that I run in the pb 10 frame appeared after the program, exit the program, again run frame, are unable to connect to the database, this could be the reason why? Connection failure: SQLState: '01000' SQL server error: '10093'... You operate the database after the data on the B, if no Disconnect the using sqlca_b; Connect using the sqlca; You see if there is no written CodePudding user response:
refer to 12 floor masword reply: references 9 f yf52393975 response: You operate the database after the data on the B, if no Disconnect the using sqlca_b; Connect using the sqlca; You see if there is no written nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull