473,287 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Trouble w/ 'create table' sql on mx.ODBC


Hello,
Lately I've been using the mx.ODBC module to query Access (mdb) tables. For
the life of me, I can't get the 'create table' sql command to work. I use
this command in Oracle and I've seen other mx.ODBC users weave into their
scripts for Access. But I still can't get this simple test run below to work
(ignore the geoprocessor object for ArcGIS):

#Import Python Standard Library Modules
import win32com.client, sys, os, string, copy, glob
import mx.ODBC.Windows as odbc

# Create the Geoprocessor Object
gp = win32com.client.Dispatch("esriGeoprocessing.GpDisp atch.1")
gp.overwriteoutput = 1

# Variables
tempspace = "C:\Documents and Settings\corr1gre\Desktop\Workspace\DBFs &
Shapefiles\TEST.mdb"
workspace = string.replace(tempspace,"\\","/")

#Conection to Access
driv = 'DRIVER={Microsoft Access Driver (*.mdb)};DBQ='+workspace
conn = odbc.DriverConnect(driv)
curse = conn.cursor()

#Upload Tbl 1 as a List of Tuples
curse.execute('SELECT TISCODE,EXISTSIN,STATUS,NOTES from Mower_I')
x = curse.fetchall()

#Create New Table
curse.execute('Create table TEST (TISCODE Integer)')
curse.close()
conn.close()
del gp
--
View this message in context: http://www.nabble.com/Trouble-w--%27....html#a9860747
Sent from the Python - python-list mailing list archive at Nabble.com.

Apr 5 '07 #1
0 1364

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

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
3
by: Ben | last post by:
Hi everyone, Now I am using Visual Basic.net to write a program but having some headaches. The situation is as follows: I am using ODBC connection to connect one database( non-SQL server) ,...
14
by: jj | last post by:
Is it possible to call a remote php script from within Access? I'm thinking something like: DoCMD... http://www.domain.com/scripts/dataquery.php DoCmd.OpenQuery "update_data", acNormal, acEdit...
9
by: Albretch | last post by:
.. I am trying to create a database in a MS Access DB via JDBC drivers. I have tried both sun.jdbc.odbc.JdbcOdbcDriver and ids.sql.IDSDriver From some reason both drivers Exceptions tell me...
1
by: Bruce Lawrence | last post by:
I know this works for Access 97. Not sure about other versions. This will create a DSN to a SQL server in your ODBC connections and then link a table of your choise from that SQL DB to the...
2
by: Maverick | last post by:
If i try to create foxpro table by the following "sql" statment, the C# compiler will only return an error "xxxx not support in non-dbc version". The "index on" command statement return some kind...
2
by: somersbar | last post by:
im trying to get a table from a microsoft access database on a simple web form using visual basic.net. ive set up the database as a file dsn. this is my connection string: DBQ=C:\Program...
3
by: Rodolfo | last post by:
Hi everybody! I'm working on a migration from Informix to SQL Server... I'm doing it through DTS and ODBC. What I'm doing is using the DTS, my data origin is tha Informix database and mi...
4
by: Tracey | last post by:
I have a Mysql database hosted on a remote server. Previously, I could always connect to those databases using the 3.51 ODBC connector and linking the tables in Access. The benefit of this is that...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.