Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sal21
Starting Member
8 Posts |
Posted - 2008-12-20 : 12:01:53
|
I have installed Sql Express on my Pc (is in lan) and have this instance:"CL151F4500\SQLEXPRESS" (CL151F4500 is the name of mine PC)Now i have coded a project in VB 6.0 and ado to connect the code with a table of Sql Express.If i run the code from my Pc all work ok but if i distribue my vb application to other user (in the same LAN) the code go in error refered acount permission...!!!sorry for confusion but ahve teated a milion of string to share database to other user...Wath is the correct strategy to share conn for all user of my LAN?Please step by step...Tks(the sql express and database are installed on win2000 pro machine) sub connessioni 'On Error GoTo UserForm_Initialize_Err Dim strDbPath As String SERVERNAME = "CL151F4500\SQLEXPRESS" DATABASENAME = "DB_PAST_DUE" 'TABLENAME = "DATI" 'TABLENAME1 = "SCHEDA" USERIDSQL = "" PASSWORDSQL = "" 'CONNESSIONE AL DATABASE - DATABASENAME Set CNSQL = New ADODB.Connection 'CNSQL.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\DB_PAS_DUE.mdb;" 'CNSQL.Open "SERVER=" & SERVERNAME & ";Database=" & DATABASENAME & ";Integrated Security=True;Connect Timeout=30;User Instance=True" 'CNSQL.Open "Data Source=" & SERVERNAME & ";Persist Security Info=True;Integrated Security=SSPI;Initial Catalog=" & DATABASENAME & "" 'CNSQL.Open "PROVIDER=SQLOLEDB;DATA SOURCE=" & SERVERNAME & ";INITIAL CATALOG=" & DATABASENAME & ";INTEGRATED SECURITY=sspi;Connect Timeout=30;User Instance=True" 'CNSQL.Open "Driver={SQL Native Client};Server=" & SERVERNAME & ";Initial Catalog=" & DATABASENAME & ";Integrated Security=SSPI;" 'strDbPath = "\\10.220.238.25\Inetpub\wwwroot\BOUASS\DB_PAS_DUE.mdb" 'CNSQL.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Persist Security Info=False;" & _ "Data Source=" & strDbPath & _ ";" 'CNSQL.Open "Driver={SQL Native Client};Server=" & SERVERNAME & "; & DATABASENAME &;Trusted_Connection = True;" CNSQLOpen "Driver={SQL Server};Server=" & SERVERNAME & ";Database=" & DATABASENAME & _ ";Trusted_Connection = True;Connect Timeout=30;User Instance=True" 'CNSQL.Close 'CNSQL.Open "Driver={SQL Native Client};Server=" & SERVERNAME & ";Database=" & DATABASENAME & "; Trusted_Connection=yes;" 'Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True; 'CNSQL.Open "Driver={SQL Server};Server=" & SERVERNAME & ";Database=" & DATABASENAME & _ ";Uid=" & USERIDSQL & ";Pwd=" & PASSWORDSQL & ";" 'CNSQL.Open "Provider=SQLOLEDB;Server=" & SERVERNAME & ";Database=" & DATABASENAME & "; Integrated Security=SSPI;" 'Set CNSQL2 = New ADODB.Connection 'Set RSSQLD = New ADODB.Recordset 'CNSQL2.Open "Driver={SQL Server};Server=" & SERVERNAME & ";Database=" & DATABASENAME & _ ";Uid=" & USERIDSQL & ";Pwd=" & PASSWORDSQL & ";" 'SSQLD = "SELECT * FROM DATE_INQ" 'RSSQLD.Open SSQLD, CNSQL2, adOpenForwardOnly, adLockReadOnly 'CONNESSIONE AL DATABASE - DATABASENAME 'PER APRIRE UN RSET DELLE TABELLE AL DATABASE - DATABASENAME 'Set RSSQL = New ADODB.Recordset 'Set RSSQL1 = New ADODB.Recordset 'RSSQL.Open TABLENAME, CNSQL, adOpenKeyset, adLockOptimistic 'RSSQL1.Open TABLENAME1, CNSQL, adOpenKeyset, adLockOptimistic 'PER APRIRE UN RSET DELLE TABELLE AL DATABASE - DATABASENAME 'SQL = "TRUNCATE TABLE TABELLA_SETT" 'CNSQL.Execute SQL 'SQL = "TRUNCATE TABLE DATI" 'CNSQL.Execute SQL 'SQL = "TRUNCATE TABLE SCHEDA" 'CNSQL.Execute SQL Call FILL_COMBO_AREA End Sub |
|
|
|
|