Home > Software engineering >  VB SQL server2008 this machine can be accessed, but in other computer network can not access
VB SQL server2008 this machine can be accessed, but in other computer network can not access

Time:10-08

() Function CNN As ADODB. Connection 'establishing a database Connection generic Function
Set the CNN=New ADODB. Connection
CNN. Open "the Provider=SQLOLEDB. 1; Integrated Security=SSPI; Persist Security Info=False; User ID=JSB. The PWD=JSBJSB; Initial Catalog=project parameter database; Data Source="& amp; Ipaddress & amp; ";"
End the Function
This is my general database connection in the module function, the ipaddress is used to enter the IP address of the database machine, to realize the input with a inputbox, SQL server2008 setting is mixed landing mode, computers in a network have also been set up, to allow remote access, also opens a guest account, and use the access database can realize the computer access, SQL server cannot, however, two major problems:
1. I am using vb software developed by access to the local SQL server database can be connected to access implementation, but cannot be achieved on the other computer local area network (LAN) connection, will pop up "computer name/GUEST logon failure", but with access database can realize the computer connection,
2. I feel like I string concatenation generic function have problem, this is the account name and password, the User ID=JSB. The PWD=JSBJSB; I just write wrong password, specially in the local can be connected, that program when the connection does not use the account password, so I'm wondering whether so will cause the failure of LAN remote connection, it is using the default Windows login mode, the mode I don't have the password, but I use the SQL server management studio in mixed mode choice, is must enter the correct password to log in, that my connection string has a problem, the system when the connection is not a hybrid mode, which master please help to give directions,

CodePudding user response:

Just test is successful, the string to CNN. Open "the Provider=SQLOLEDB. 1; Persist Security Info=true; User ID=JSB. The PWD=JSBJSB; Initial Catalog=project parameter database; Data Source="& amp; Ipaddress & amp; ";" With respect to OK, Integrated Security=SSPI the delete will default to use the user id account, Persist Security Info=true to true will automatically save the password, don't every time to establish a connection to the input password, which will help in program operation error,

CodePudding user response:

this for a long time
  • Related