[adodbapi] cannot create table

S

Sangbae

I cannot create table using adodbapi.
I have no problem with SELECT etc.

But I can create table using win32com.client directly.
I don't know why.

Could you give some advice, please?

This is my source.
=====================================
from adodbapi import adodbapi

DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=test.mdb;'
stdconn = adodbapi.connect(DSN)
cur = stdconn.cursor()

query = """
CREATE TABLE table01 (
id COUNTER(1, 1) PRIMARY KEY,
name VARCHAR(255) NOT NULL DEFAULT "",
comment VARCHAR(255) NOT NULL DEFAULT ""
)"""

# api
cur.execute(query)
cur.close()
stdconn.close()
======================================
 
B

Bob Gailer

I cannot create table using adodbapi.

<gripe on>
I have the same problem especially with Microsoft messages: "Cannot do blah
blah". No hint as to what the problem is.
<gripe off>

PLEASE tell us what the symptom is. Error message, no error message but
also no new table, or what?
I have no problem with SELECT etc.

But I can create table using win32com.client directly.
I don't know why.

Could you give some advice, please?

This is my source.
=====================================
from adodbapi import adodbapi

DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=test.mdb;'
stdconn = adodbapi.connect(DSN)
cur = stdconn.cursor()

query = """
CREATE TABLE table01 (
id COUNTER(1, 1) PRIMARY KEY,
name VARCHAR(255) NOT NULL DEFAULT "",
comment VARCHAR(255) NOT NULL DEFAULT ""
)"""

# api
cur.execute(query)
cur.close()
stdconn.close()
======================================

Bob Gailer
(e-mail address removed)
303 442 2625
 
S

Sangbae

There were no error messsages.

It seemed to be OK.

But there were no table that I tried to create.

It is strange!!
 
B

Bob Gailer

I cannot create table using adodbapi.
I have no problem with SELECT etc.

But I can create table using win32com.client directly.
I don't know why.

Could you give some advice, please?

This is my source.
=====================================
from adodbapi import adodbapi

DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=test.mdb;'
stdconn = adodbapi.connect(DSN)
cur = stdconn.cursor()

query = """
CREATE TABLE table01 (
id COUNTER(1, 1) PRIMARY KEY,
name VARCHAR(255) NOT NULL DEFAULT "",
comment VARCHAR(255) NOT NULL DEFAULT ""
)"""

# api
cur.execute(query)
cur.close()

stdconn.commit() # Add this and viola!
stdconn.close()
======================================

Bob Gailer
(e-mail address removed)
303 442 2625
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top