Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: FRANKI am 19.02.04 - 10:36:56
-
Hallo Leute,
wie bekomme ich am besten MS Access Daten (mögl. online) in eine Notes-DB??
Danke
FRANKI
-
Per ODBC.
Bernhard
-
.... oder COM ...
-
... oder die daten als excel-datei abspeichern, sich hier den import-agenten besorgen, fertig :)
-
könnt Ihr mir da ein wenig mehr infos zu geben?
danke
FRANKI
-
... was ist "da" ???
-
also, "da" bedeutet, wo bekomme ich den import-agenten her??
und "da" bedeutet, wie mache ich das mit "com" .
Leider scheidet ODBC aus, da der Server unter AIX läuft....
Danke
FRANKI
-
Dann scheidet aber auch COM aus.
Schildere doch mal genauer, was Du überhaupt willst.
-
Ich habe eine MDB-Datei (MS Access).
Ich habe eine Notes-Anwendung, die im Browser läuft.
Diese Anwendung möchte ich erweitern, in dem ich auch noch Informationen aus der MDB-Datei im Browser verfügbar mache.
Die Anwendung läuft schon mit DB2-Zugriffen über JDBC.
Leider kenne ich mich überhaupt nicht mit Access aus.
Kann ich da auch per JDBC dran??
Wenn ja, wo bekomme ich den entspr. JDBC-Treiber her?
FRANKI
-
hier ist der import : (schaltfläche in ansicht)
Sub Click(Source As Button)
'The action button is located on a view
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim temp1 As String
Dim temp2 As String
Dim temp3 As String
Dim xlApp As Variant
Dim xlSheet As Variant
Dim cursor As Integer
Dim recordcheck As String
On Error Goto ERRORLABEL
Dim FileName As String
Dim DefaultFileName As String
DefaultFileName="c:\xxx\yyy.xls"
NamePrompt$="Enter the complete Path and File Name of the Excel file to be imported:" &Chr(13)
FileName=Inputbox(NamePrompt$,"Import File Name Specification",DefaultFileName,100,100)
If FileName="" Then Exit Sub
'Create an Excel object for the spreadsheet
'It may be necessary to have the proper MS Office DLLs installed on the PC running this application
'That is, the person must be able to open the XLS file with Excel
Set xlApp = CreateObject("excel.Application")
xlApp.Application.Workbooks.Open Filename
'File not found will return ERR=213 and the routine will be ended
With xlApp.workbooks.Add
'Not sure what this line is for, unless it's to be sure that at least one workbook is present in the XLS file
End With
'Stop
Set xlSheet = xlApp.Workbooks(1).Worksheets(1)
recordcheck="x"
r=1 ' Row counter - first row contains fieldnames from the database;
'these fieldnames are not needed as long as the spreadsheet follows a specified format
While recordcheck <>"ENDE"
'Recordcheck = "0" when there is no value in the first cell of the row, if integer, or "", if string
'Important - Set r to a value that will stop the import routine without missing any data, if the other criteria do not
'For this example, six columns are imported
cursor=0
r=r+1
temp1=xlSheet.Cells(r,1).value
recordcheck=Cstr(temp1)
If recordcheck="0" Then Goto Finished ' Avoid generating empty record
temp2=xlSheet.Cells(r,2).value
temp3=xlSheet.Cells(r,3).value
'The above lines lines could be combined with those below, but keep separate for ease in debugging until ready to finalize the code
Set doc = New NotesDocument(db)
doc.Form = "abschiebung"
doc.nummer= temp1
doc.name = Strconv(temp2 , 3)
Call Doc.Save(True, False)
Finished:
Wend
Goto SubClose
ERRORLABEL:
'Msgbox "An error was encountered."
'Print "Error: " Error(), " Err:" Err(), " Erl:" Erl()
If Err=213 Then
Messagebox Filename & " was not found. Verify Path and Filename, then try the Import again."
Exit Sub
Else
Messagebox "Error" & Str(Err) & ": " & Error$
End If
Resume Next
SubClose:
xlApp.activeworkbook.close
xlApp.Quit
Set xlapp = Nothing
Set view=db.getview("xxxx")
Call ws.viewrefresh
End Sub
-
Wenn ich das richtig verstehe, sollen die Daten online, sprich Live aus der Access-DB ausgelesen werden ?
Oder wenigstens ständig aktualisiert werden ?
In dem Fall ist der Import-Agent vielleicht nicht unbedingt sinnvoll, da jedesmal aus Access heraus eine Importdatei erzeugt werden muß.
Auf Access kann auch per JDBC zugegriffen werden. Dies hat Google mir dazu ausgespuckt :
http://home-1.worldonline.nl/~bmc88/java/jdbc/
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2691&lngWId=2
http://www.npac.syr.edu/users/gcf/cps616advancedjdbc/
-
Das hilft mir erst mal weiter!
Danke
FRANKI