:
The Code is as follows:
Public m As String, l As String, strdata As String
Private Sub commandementclick ()
Dim cn As New ADODB. Connection
On Error GoTo dataErr
Cn. Open "Provider = SQLOLEDB.1; Persist Security Info = False; Data Source = zhan; User ID = sa; password = zhan; Initial Catalog = master"
1 cn. execute ("sp_attach_db @ dbname ='' "& strdata &" '', @ filename1 = N" & "'' "& m &"'', @ filename2 = N "&" ''" & l &"''")
MsgBox "appended! "," VB additional Database"
Exit Sub
DataErr:
MsgBox Err. Description, "VB additional Database"
End Sub
Private Sub Command2_Click ()
With CommonDialog1
. InitDir = "E: mrfl File Modified on the ASP disc"
. ShowOpen
If. FileName <> "" Then
Text1 =. FileName
M =. FileName
L = Mid (. FileName, 1, Len (. FileName)-8) & "Log. LDF"
Strdata = Mid (. FileTitle, 1, Len (. FileTitle)-9)
If List1.ListCount> 0 Then
List1.Clear
& Nbs
<