AW: Danke! Eine Frage noch
21.01.2009 13:35:00
magicman
Hallo Luschi,
danke für deine Mühe, aber bei mir steigt der Rechner immer noch aus:
Private Sub CommandButton1_Click()
Dim s1 As String, s2 As String, s3 As String, s4 As String
If "" = Me.TextBox2.Value Then
MsgBox "Programm - Abbruch", 16, "H i n w e i s"
Exit Sub
End If
If pT Is Nothing Then
Exit Sub
End If
s1 = Trim(Me.TextBox2.Value)
If ("" = s1) Or ("" = Dir(s1)) Then
Exit Sub
End If
s2 = "ODBC;DSN=Microsoft Access-Datenbank;DBQ=" & s1 & _
";DefaultDir=" & nurPfad(s1) & ";DriverId=25;FIL=MS Access;MaxBufferSize=2048" & _
";PageTimeout=5;"
'MsgBox s2
Debug.Print s2
pT.PivotCache.Connection = s2
s1 = pT.PivotCache.CommandText
'MsgBox s1
Debug.Print s1
s2 = alteDatei(s1)
Debug.Print s2
s3 = neueDatei(Trim(Me.TextBox2.Value))
Debug.Print s3
s4 = Replace(s1, s2, s3, 1, -1, vbTextCompare)
Debug.Print s4
pT.PivotCache.CommandText = s4
pT.PivotCache.Refresh
'MsgBox pT.PivotCache.Connection & vbCrLf & vbCrLf & pT.PivotCache.CommandText
Me.TextBox3.Value = pT.PivotCache.Connection
Me.TextBox4.Value = pT.PivotCache.CommandText
'Unload Me
End Sub
Und zwar in der Zeile: pT.PivotCache.CommandText = s4
Kannst Du mir da weiterhelfen?
Gruß
Michael