I want to set a numeric column in an Access d.b., to NOT NULL WITH DEFAULT as in SqlBase
Asking for the correct syntax in an Access forum, i got that:
"ALTER TABLE Pippo ALTER COLUMN c_nome > Int NOT NULL DEFAULT 0"
"CREATE TABLE Pippo (c_nome Int NOT NULL DEFAULT 0)"
but I get an error when trying it from SqlTalk or SqlWindows.
ACCESS:-3551[Microsoft][Driver ODBC Microsoft Access] Syntax error in CREATE TABLE.
I am connected via ODBC with connection string in the Sql.ini file.
REMOTEDBNAME=MANAGER,Driver=Microsoft Access Driver (*.mdb);Dbq=G:\database\access\manager.mdb;MaxBufferSize=2048;PageTimeout=5;UID=admin;
They told me to use Currentproject.Connection.Execute "ALTER TABLE Pippo ALTER COLUMN c_nome Int NOT NULL DEFAULT 0" but how substitute this sintax to Gupta?
If it works in Access, then likely ODBC doesn't support that. Though I'm a bit surprised the router parses the string, rather than just letting it pass through to the DB. If it does not work in Access, something else is wrong. Is that syntax dependent on a certain version of Access?
Following access forum hints, I did that. I created and executed one sub like this from inside Access:
CurrentProject.Connection.Execute "CREATE TABLE Pippo (c_nome Int NOT NULL DEFAULT 0)"
and it runs. The table has been created with predefined value 0. Now the problem is that my customers don't have Access as a part of Office. I only deploy the d.b..
This link: http://office.microsoft.com/en-us/acces ... 61033.aspx
would seem a good place to start looking for how to do that. FYI, I searched the string: ms access runtime license
and that was the first link which appeared.
The DEFAULT statement is correctly interpreted only in ADODB connections. so I must try to connect via ADODB "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\database\access\manager.mdb"
Who is online
Users browsing this forum: [Ccbot] and 2 guests