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 8028279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:05:32+00:00 2026-06-05T00:05:32+00:00

This is all new to me to please bear with me! I have a

  • 0

This is all new to me to please bear with me!

I have a situation where we have a form on a website which collects data and sends it to a mySQL table on a web server. That info is sent to a mySQL table on a linux box from the web server, I believe through some kind of import script on the linux box.

Last week our linux server got hung up and now the import scripts aren’t working. I have a import.txt file that I need to restart (I believe) but am not sure how to do it.

I researched on the web but I only see info about .sh files.

Thanks!

Here’s what I need to run if that helps:

Public Sub ImportPubOrders()
Dim rsCopy1 As Recordset, rsCopy2 As Recordset, rsCopy3 As Recordset
Dim strSQL As String, strCriteria As String, strODBCdate As String
Dim lngFound As Long
On Error GoTo ErrorHandler

Set wrkODBC = CreateWorkspace("ODBCWorkSpace", "pubadmin", "Abo1prA5", dbUseODBC)
Set MySQLConn = wrkODBC.OpenConnection("ODBC;DSN=publications;DESC=MySQL ODBC 3.51 Driver DSN;DATABASE=publications;SERVER=10.116.11.2;UID=pubadmin;PASSWORD=Abo1prA5;PORT=3306;OPTION=3;STMT=;")
MySQLConn.QueryTimeout = 180

strODBCdate = Format(DateAdd("d", -1, Date), "yyyy-mm-dd")
'strODBCdate = "2009-03-11"

'Copy records from More.net PRO to DBSRVR
Set OAwrkODBC = CreateWorkspace("ODBCWorkSpace", "sslAGOmySQL", "k4-4js94nd", dbUseODBC)
Set OAMySQLConn = OAwrkODBC.OpenConnection("ODBC;DSN=OA_generalPRO;DESC=MySQL ODBC 3.51 Driver DSN;DATABASE=www_ago_mo_gov_ssl_data;SERVER=db.kinetic.more.net;UID=sslAGOmySQL;PASSWORD=k4-4js94nd;PORT=3306;OPTION=3;STMT=;")

strSQL = "LOCK TABLE orders_contacts READ, orders_ids READ, orders_items READ, orders_order READ"
OAMySQLConn.Execute (strSQL)

    'Check if there are orders to download
    strCriteria = "DATE_FORMAT(orders_order.order_date, '%Y-%m-%d') = " & Chr(34) & strODBCdate & Chr(34)
    strSQL = "SELECT form_id FROM orders_order WHERE " & strCriteria
    OAMySQLConn.Execute (strSQL)
    lngFound = OAMySQLConn.RecordsAffected

    'Orders have been submitted and need to be downloaded
    If lngFound >= 1 Then
        strSQL = "SELECT form_id, contact_id, DATE_FORMAT(order_date, '%Y-%m-%d %T') AS order_date FROM orders_order WHERE " & strCriteria
        Set rsCopy1 = OAMySQLConn.OpenRecordset(strSQL)
        Do While Not rsCopy1.EOF
            strSQL = "INSERT INTO orders_order (form_id, contact_id, order_date) " & _
                "VALUES (" & rsCopy1!form_id & ", " & rsCopy1!contact_id & ", " & Chr(34) & rsCopy1!order_date & Chr(34) & ")"
            MySQLConn.Execute (strSQL)
            rsCopy1.MoveNext
        Loop
        rsCopy1.Close

        strSQL = "SELECT item_id, orders_items.form_id, pub_name, quantity " & _
            "FROM orders_items INNER JOIN orders_order ON orders_items.form_id = orders_order.form_id " & _
            "WHERE " & strCriteria
        Set rsCopy2 = OAMySQLConn.OpenRecordset(strSQL)
        Do While Not rsCopy2.EOF
            strSQL = "INSERT INTO orders_items (item_id, form_id, pub_name, quantity) " & _
                "VALUES (" & rsCopy2!item_id & ", " & rsCopy2!form_id & ", " & Chr(34) & rsCopy2!pub_name & Chr(34) & ", " & rsCopy2!quantity & ")"
            MySQLConn.Execute (strSQL)
            rsCopy2.MoveNext
        Loop
        rsCopy2.Close

        strSQL = "SELECT orders_contacts.contact_id, orders_contacts.form_id, org_name, first_name, last_name, address1, address2, city, state, " & _
            "zip, email, phone, DATE_FORMAT(date_added, '%Y-%m-%d %T') AS date_added " & _
            "FROM orders_contacts INNER JOIN orders_order ON orders_contacts.contact_id = orders_order.contact_id " & _
            "WHERE " & strCriteria
        Set rsCopy3 = OAMySQLConn.OpenRecordset(strSQL)
        Do While Not rsCopy3.EOF
            strSQL = "INSERT INTO orders_contacts (contact_id, form_id, org_name, first_name, last_name, address1, " & _
                "address2, city, state, zip, email, phone, date_added) " & _
                "VALUES (" & rsCopy3!contact_id & ", " & rsCopy3!form_id & ", " & Chr(34) & rsCopy3!org_name & Chr(34) & _
                ", " & Chr(34) & rsCopy3!first_name & Chr(34) & ", " & Chr(34) & rsCopy3!last_name & Chr(34) & _
                ", " & Chr(34) & rsCopy3!address1 & Chr(34) & ", " & Chr(34) & rsCopy3!address2 & Chr(34) & _
                ", " & Chr(34) & rsCopy3!city & Chr(34) & ", " & Chr(34) & rsCopy3!state & Chr(34) & _
                ", " & Chr(34) & rsCopy3!zip & Chr(34) & ", " & Chr(34) & rsCopy3!email & Chr(34) & _
                ", " & Chr(34) & rsCopy3!phone & Chr(34) & ", " & Chr(34) & rsCopy3!date_added & Chr(34) & ")"
            MySQLConn.Execute (strSQL)
            rsCopy3.MoveNext
        Loop
        rsCopy3.Close

    Else
        DoCmd.Hourglass False
        Dim RS0 As Recordset
        Set RS0 = CurrentDb.OpenRecordset("log_Errors")
        RS0.AddNew
            RS0("error_loc") = "ZERO publication orders submitted online for " & strODBCdate
            RS0("error_time") = Now()
        RS0.Update
        RS0.Close
        Set RS0 = Nothing
    End If

strSQL = "UNLOCK TABLES"
OAMySQLConn.Execute (strSQL)

DoCmd.Hourglass False

Dim RS10 As Recordset
Set RS10 = CurrentDb.OpenRecordset("log_Errors")
RS10.AddNew
    RS10("error_loc") = "Import publications completed without error"
    RS10("error_time") = Now()
RS10.Update
RS10.Close
Set RS10 = Nothing

DoCmd.SetWarnings True
Exit Sub

ErrorHandler:
DoCmd.Hourglass False
    Dim RS2 As Recordset
    Set RS2 = CurrentDb.OpenRecordset("log_Errors")
    RS2.AddNew
        RS2("error_loc") = "procedure ImportPubOrders"
        RS2("error_num") = Err.Number
        RS2("error_desc") = Err.Description
        RS2("error_time") = Now()
    RS2.Update
    RS2.Close
    Set RS2 = Nothing

Set rsCopy1 = Nothing
Set rsCopy2 = Nothing
Set rsCopy3 = Nothing
DoCmd.SetWarnings True

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-06-05T00:05:34+00:00Added an answer on June 5, 2026 at 12:05 am

    You would have to use third party libraries as linux does not support VBScript. And are you sure that it is has the .txt extension? If so what is this about VBScript?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to CSS, so please bear with me. I have this form
I am fairly new to all this, so please bear with me! I have
I have looked everywhere for help on this. I'm new to all this and
Im very new to all coding including jquery. I though this would have been
I am rather new to all things JavaScript so please bear with me :)
I'm coming from C# and very new at this so please bear with me.
I'm kind of new to C, so please bear with me. I have a
Please bear with me, I am new to Uniscribe so I hope this isn't
I'm new to Javascript, please bear with me. I have a code similar to
I am new to WPF/XAML so please bear with the noob question. 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.