473,830 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

import SQL statements

Hi, I'm an Access newbie and need to update an Access database from a
web application. I'll need to add new records and also update existing
ones.

What I was thinking of doing is have my web app create a text file with
Access SQL INSERT/UPDATE statements and get Access to import and
execute this file.

Is this possible?

Thanks,
Kevin

Nov 13 '05
16 3298

kl***@solomon.i e wrote:
Hi Kevin,
[---]
The problem will be to update existing records. I've been searching
this group and seen a post on a pass-through query - this looks
promising i think. I think I can use this to have my web app write
INSERT/UPDATE statements and run them on Access, is this right?


I've had the same situation- and it's definitely not pretty; First,
devise a query that determines the existing records; next, you can
either delete all the "old" records and perform a single "INSERT"
statement or insert "new blank" records and make one "UPDATE" sql
statement... Your call on that one.

HTH-

KevDot

Nov 13 '05 #11
Hi David,

Many thanks for your detailed posting.

This is a silly question, but I'm totally at sea when it comes to MS
technoglogy. Is that code you posted VB? And where would I enter it
into Access?

Thanks,
KEvin

Nov 13 '05 #12
kl***@solomon.i e wrote in
news:11******** *************@g 14g2000cwa.goog legroups.com:
Many thanks for your detailed posting.

This is a silly question, but I'm totally at sea when it comes to
MS technoglogy. Is that code you posted VB? And where would I
enter it into Access?


Yes, it's VB, but the dialect of it known as VBA, Visual Basic for
Applications. The core DLL for VBA is the same as the core DLL for
VB, but one is not a superset or subset of the other -- they just
overlap a lot.

The easiest place to put the code I wrote is in the Access database,
or in an Access database that has tables linked to the datafile
you're processing. It would be executed from Access.

In the apps where I've done this, I had a dialog form where the user
initiated the writing of the text files with the data from the
website (by calling a CGI script on the website), then ran an FTP
script locally to download the files from the website to the local
PC, then imported the text files into buffer tables in an Access
database (a temporary file that was replaced after each use to avoid
bloat), then linked to the front end the dialog was launched from.
Then the SQL would use the tables in that front end as though all of
them were local to that database.

Hope that makes sense -- ask if it doesn't.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #13
Thanks for that. Do I put it into the modules under objects?

I've been looking on the web for a simple "hello world" type
examplejust to get me started but cant find one. Could you recomend a
site/book ?

I'd be interested to the code you used to open and read in a local
file. I think I'd prefeer just to work directly from the file (reading
into an array then looping through the array issuing SQL to Access)
rather than use a linked table - i will have a very small volume of
updates. Ideally, I'd like to include an MD5 checksum within the file,
I assume VBA has MD5 functions?

Many thanks,
KEvin

Nov 13 '05 #14
<kl***@solomon. ie> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Thanks for that. Do I put it into the modules under objects?

I've been looking on the web for a simple "hello world" type
examplejust to get me started but cant find one. Could you recomend a
site/book ?

I'd be interested to the code you used to open and read in a local
file. I think I'd prefeer just to work directly from the file (reading
into an array then looping through the array issuing SQL to Access)
rather than use a linked table - i will have a very small volume of
updates. Ideally, I'd like to include an MD5 checksum within the file,
I assume VBA has MD5 functions?

Many thanks,
KEvin

I did send an e-mail offering to send an import demo. Is your e-mail
address valid?
Nov 13 '05 #15
Hi Justin,

I didnt get it,or I may have deleted it (get so much spam, tend to del
anythig from people I dont know). My address is klowe at.symbol
solomon dot ie

Thanks,

KEvin

Nov 13 '05 #16
kl***@solomon.i e wrote in
news:11******** **************@ g47g2000cwa.goo glegroups.com:
Thanks for that. Do I put it into the modules under objects?

I've been looking on the web for a simple "hello world" type
examplejust to get me started but cant find one. Could you
recomend a site/book ?
The code goes in a module. You may want to build a UI to call that
code.
I'd be interested to the code you used to open and read in a local
file. I think I'd prefeer just to work directly from the file
(reading into an array then looping through the array issuing SQL
to Access) rather than use a linked table - i will have a very
small volume of updates. Ideally, I'd like to include an MD5
checksum within the file, I assume VBA has MD5 functions?


You can use SQL on linked tables, so why would you want to do it
sequentially? An all-SQL solution is going to be vastly easier to
code.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2249
by: Matthew Wilson | last post by:
Hi- I'm writing a bunch of classes, several of which need functions and variables defined in the math module. In some instances, I'm going to import my module like this: import myshapes and then in others, I'll do:
2
1509
by: Aahz | last post by:
There were some posts recently discussing whether it's poor style to put import statements inside functions. I recently got reminded that there's one very good reason to avoid it: Python has an import lock that blocks more than one thread from executing import statements. Putting import statements inside functions that might be called in a threaded environment is asking for deadlock trouble. -- Aahz (aahz@pythoncraft.com) ...
4
2200
by: MackS | last post by:
Hi I'm new to Python, I've read the FAQ but still can't get the following simple example working: # file main_mod.py: global_string = 'abc' def main():
1
4175
by: Dennis B. Hansen | last post by:
Hi all... I'm having some problems JAXB compiling som schemas, and was wondering if what i was trying to do is simply wrong... the problem seems to be with my import statements, and I've tried to create a simple example that generates the error (included below). I have two imported schemas, and JAXB seems to only want to import one of them (possibly because they have same namespace (???)).
5
1956
by: ChaosKCW | last post by:
Hi I was wondering if someone could help with the import statements needed to use the timeit module in the following code. I need to access the "cur" object. Thanks, import cx_Oracle import timeit
23
6428
by: Shane Hathaway | last post by:
Here's a heretical idea. I'd like a way to import modules at the point where I need the functionality, rather than remember to import ahead of time. This might eliminate a step in my coding process. Currently, my process is I change code and later scan my changes to make matching changes to the import statements. The scan step is error prone and time consuming. By importing inline, I'd be able to change code without the extra scan...
1
1414
by: Shane Hathaway | last post by:
Let's talk about the problem I really want help with. I brought up a proposal earlier, but it was only half serious. I realize Python is too sacred to accept such a heretical change. ;-) Here's the real problem: maintaining import statements when moving sizable blocks of code between modules is hairy and error prone. I move major code sections almost every day. I'm constantly restructuring the code to make it clearer and simpler, to...
5
1746
by: W. Watson | last post by:
Is there a single source that explains these statements? ------------------------------ from Tkinter import * from Numeric import * import Image import ImageChops import ImageTk import time import binascii import tkMessageBox
3
6123
by: notnorwegian | last post by:
import Tkinter from Tkinter import * i have a program where if i comment out either of those import- statements i get an error. i thought they meant the same thing and from was supposed to be just to imort just a specific function and the * imports everything in the module. but aparently the above statements have diffrent meaning and i cant
1
953
by: Robert Kern | last post by:
Patrick Bouffard wrote: I don't know of any automatic tools. I usually comment out those import statements and use pyflakes to show me the undefined names. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10777
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10493
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10526
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10206
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3960
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.