Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 944617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:37:16+00:00 2026-05-15T22:37:16+00:00

I have a file like this: strPath = S:\HR\Forms\forms_database.accdb I am connecting to it

  • 0

I have a file like this:

strPath = "S:\HR\Forms\forms_database.accdb"

I am connecting to it through an WORD adodb.connection

should my database be a different extension ? MDB or something?

I am getting this error when it tries to connect:

unrecognized database format 's:...............accdb'

what’s going on here?

here’s the entire code:

Sub TransferShipper()

  'Transfer new shipping company record to

  'Shippers table in Northwind database.

  Dim cnn As ADODB.Connection
  Dim strConnection As String
  Dim strSQL As String
  Dim strPath As String
  Dim doc As Word.Document
  Dim strCompanyName As String
  Dim strPhone As String
  Dim bytContinue As Byte
  Dim lngSuccess As Long
  Set doc = ThisDocument
  On Error GoTo ErrHandler

  strCompanyName = Chr(39) & doc.FormFields("txtCompanyName").Result & Chr(39)
  strPhone = Chr(39) & doc.FormFields("txtPhone").Result & Chr(39)
  'Confirm new record.
  bytContinue = MsgBox("Do you want to insert this record?", vbYesNo, "Add Record")
  Debug.Print bytContinue
  'Process input values.
  If bytContinue = vbYes Then
    strSQL = "INSERT INTO vacation " _
     & "(title, department) " _
     & "VALUES (" _
     & strCompanyName & ", " _
     & strPhone & ")"
    Debug.Print strSQL
    'Substitute path and connection string with DSN if available.
    strPath = "S:\HR\Forms\forms_database.accdb"
    strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
     & "Data Source = " & strPath
    Debug.Print strConnection
    Set cnn = New ADODB.Connection
    cnn.Open strConnection
    cnn.Execute strSQL, lngSuccess
    cnn.Close
    MsgBox "You inserted " & lngSuccess & " record", _
     vbOKOnly, "Error Added"
    doc.FormFields("txtCompanyName").TextInput.Clear
    doc.FormFields("txtPhone").TextInput.Clear
  End If
  Set doc = Nothing
  Set cnn = Nothing
  Exit Sub
ErrHandler:
  MsgBox Err.Number & ": " & Err.Description, _
   vbOKOnly, "Error"
  On Error GoTo 0
  On Error Resume Next
  cnn.Close
  Set doc = Nothing
  Set cnn = Nothing
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:37:17+00:00Added an answer on May 15, 2026 at 10:37 pm

    Try ACE OLEDB 12.0 as the db version.

    "Provider=Microsoft.ACE.OLEDB.12.0"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You want to call vprintf() instead of printf(). May 16, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer You can find some help in the IDEA forum thread.… May 16, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer In your first example, main2.cpp defines a global variable i,… May 16, 2026 at 6:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have file something like this hostname ser1-xyz myuser name passwd secret group 1234
I have a file like this: 1 2 3 4 5 6 7 6
I have a file like this: my line - some words & text oh
i have text file like this: i am fine how are you what i
I have a file like this compiled into a dll file and placed in
I have a file like this. rm a.txt mkdir foo cp a.doc docs I
i have a file like this: term1 term2 term3 term4 term2 term1 term5 term3
I have XAML file like this <UserControl x:Class=UISkripsi3.Sidebar xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:UISkripsi3=clr-namespace:UISkripsi3 xmlns:local=clr-namespace:UISkripsi3>
i have a config file like this: ?xml version=1.0 encoding=utf-8 ? configuration appSettings add
i have a text (text.txt) file like this: shir beer geer deer i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.