By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,505 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

change field values

P: 1
Hello; how can I change the field value that is a letter and change it to a number value and be able to add the column or row?

Thanks
Russ
Nov 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: 4
I dont know what do you excatly want to do but you can try this:

db.Execute ("ALTER TABLE table1 ALTER COLUMN column1 Double")
or
db.Execute ("ALTER TABLE table1 ADD COLUMN column1 Double")
Nov 22 '06 #2

PEB
Expert 100+
P: 1,418
PEB
I dont know what do you excatly want to do but you can try this:

db.Execute ("ALTER TABLE table1 ALTER COLUMN column1 Double")
or
db.Execute ("ALTER TABLE table1 ADD COLUMN column1 Double")
He he this seems doesn't concern MS Access database!

Only for databases that support this syntax!

Ms Access database, i think don't support this one!

See tabledefs property in Access help!


CreateTableDef Method Example
CreateTableDef Method Example

This example creates a new TableDef object in the Northwind database.

Sub CreateTableDefX()

Dim dbsNorthwind As Database
Dim tdfNew As TableDef
Dim prpLoop As Property

Set dbsNorthwind = OpenDatabase("Northwind.mdb")

' Create a new TableDef object.
Set tdfNew = dbsNorthwind.CreateTableDef("Contacts")

With tdfNew
' Create fields and append them to the new TableDef
' object. This must be done before appending the
' TableDef object to the TableDefs collection of the
' Northwind database.
.Fields.Append .CreateField("FirstName", dbText)
.Fields.Append .CreateField("LastName", dbText)
.Fields.Append .CreateField("Phone", dbText)
.Fields.Append .CreateField("Notes", dbMemo)

Debug.Print "Properties of new TableDef object " & _
"before appending to collection:"

' Enumerate Properties collection of new TableDef
' object.
For Each prpLoop In .Properties
On Error Resume Next
If prpLoop <> "" Then Debug.Print " " & _
prpLoop.Name & " = " & prpLoop
On Error GoTo 0
Next prpLoop

' Append the new TableDef object to the Northwind
' database.
dbsNorthwind.TableDefs.Append tdfNew

Debug.Print "Properties of new TableDef object " & _
"after appending to collection:"

' Enumerate Properties collection of new TableDef
' object.
For Each prpLoop In .Properties
On Error Resume Next
If prpLoop <> "" Then Debug.Print " " & _
prpLoop.Name & " = " & prpLoop
On Error GoTo 0
Next prpLoop

End With

' Delete new TableDef object since this is a
' demonstration.
dbsNorthwind.TableDefs.Delete "Contacts"

dbsNorthwind.Close

End Sub
Nov 27 '06 #3

NeoPa
Expert Mod 15k+
P: 31,186
Russ,

I hope some of these answers fit your question.
If not, you could try rephrasing your question. I have to admit I couldn't post an answer because I have no idea what you're actually looking for :(.
Nov 27 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.