Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Aus VB heraus neue MDB Access Datenbank erstellen

Empfohlene Antworten

Veröffentlicht

Hi

hat zufällig jemand einen Code dafür?

Ich möchte aus einer VB-Applikation heraus

eine neue Datenbank

an einem Ort meiner respektive des Benutzers Wahl

mit verschiedenen Feldern

und *WICHTIG* diese dann auch gleich füllen!

erstellen.

Für Hilfe wäre ich sehr dankbar!

Mfg

Stefan

Hi,

ich kann dir im Moment leider keinen Code posten, aber vieleicht hilft dir das ja ein wenig weiter:

Als erstes musst du eine Datei mit der Endung mdb erzeugen. Der User soll wohl den Ort wählen, dies kannst du mit OpenFile .. na gut... hier doch ein wenig Code...


Option Explicit


       Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _

         "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long


       Private Type OPENFILENAME

         lStructSize As Long

         hwndOwner As Long

         hInstance As Long

         lpstrFilter As String

         lpstrCustomFilter As String

         nMaxCustFilter As Long

         nFilterIndex As Long

         lpstrFile As String

         nMaxFile As Long

         lpstrFileTitle As String

         nMaxFileTitle As Long

         lpstrInitialDir As String

         lpstrTitle As String

         flags As Long

         nFileOffset As Integer

         nFileExtension As Integer

         lpstrDefExt As String

         lCustData As Long

         lpfnHook As Long

         lpTemplateName As String

       End Type


       Private Sub Command1_Click()

         Dim OpenFile As OPENFILENAME

         Dim lReturn As Long

         Dim sFilter As String

         OpenFile.lStructSize = Len(OpenFile)

         OpenFile.hwndOwner = Form1.hWnd

         OpenFile.hInstance = App.hInstance

         sFilter = "Batch Files (*.bat)" & Chr(0) & "*.BAT" & Chr(0)

         OpenFile.lpstrFilter = sFilter

         OpenFile.nFilterIndex = 1

         OpenFile.lpstrFile = String(257, 0)

         OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1

         OpenFile.lpstrFileTitle = OpenFile.lpstrFile

         OpenFile.nMaxFileTitle = OpenFile.nMaxFile

         OpenFile.lpstrInitialDir = "C:\"

         OpenFile.lpstrTitle = "Use the Comdlg API not the OCX"

         OpenFile.flags = 0

         lReturn = GetOpenFileName(OpenFile)

         If lReturn = 0 Then

            MsgBox "The User pressed the Cancel Button"

         Else

            MsgBox "The user Chose " & Trim(OpenFile.lpstrFile)

         End If

       End Sub


Dann greifst du auf diese Datenbank, am besten wohl mit ADO (z.B. 2.5) zu (Connection String... ect.) und erstellst über einen SQL deine Tabellen ect.

Erst jetzt kannst du die erstellten Tabellen mit einem weiteren SQL füllen...

Dokumentation findest du eigentlich überall, vor allem in der MSDN (F1) in der Entwicklungsumgebung...

Es macht mehr Sinn, sich ein wenig damit auseinander zu setzen, anstatt irgendeinen Source Code zu kopieren ;) Les' dich mal rein...

Gruß

dev

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.