hi
i'm receiving anerror message while executing this statement.

dr.Execute ("alter table results12 add (Total number,Percentage number,Status char(5))")

error message

run-time error:3292
syntax error in field definition

It must be

dr.Execute ("alter table results12 add Total number,Percentage number,Status char(5)")

remove the Parenthesis for the Fields list provided.

hi
i tried without parenthesis too
but if the parenthesis is removed,it is showing syntax error in alter statement.

What is the Database Backend u r using??

It worked for me with VB 6.0 and MS-Access Database.

If SQL Server use the query below

dr.Execute "ALTER TABLE results12 ADD Total Numeric, Percentage Numeric, Status char(5)"

By the way what is type of variable dr ? is it ADODB.Connection?

hi
i'm also using MS-Access as backend
dr is a DAO connection.
i have included another alter statement.but its working.
anyhow once again i'll try with ur syntax and update it to u.
thank u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.