Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Visual Basic 6.0 To Create New Fields in Microsoft Access 3

Status
Not open for further replies.

Askeladden

Programmer
Jan 28, 2004
87
NO
I need to create New Fields in Access using VB6.0. Is ther a way I might do this? If so, how?
Thanks ahead of time. :)
 
Hi dilettante,

I guess it would be, just guess we all have different styles and ways of doing things. Mine by the sound of it is not the most efficient...

Harleyquinn
 
Dim Conn As New ADODB.Connection
Dim StrCon As String

StrCon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Password=;User ID=;" & _
"Data Source=c:\IKDV\Vedlikeholds_Rutiner.mdb;" & _
"Persist Security Info=True;"

Conn.Open StrCon

If Conn.State <> adStateOpen Then
MsgBox "Error Connecting to database" 'If you get here you have a problem with your connection
'String or your database
Else
For i = LinkFelt - 1 To lstDocs.ListCount - 1
'set and execute SQL string
Conn.Execute "ALTER Table [Vedlikeholds Rutiner] ADD COLUMN Link" & LinkFelt & " Text(50)"
Next
End If

If Conn.State = adStateOpen Then Conn.Close
Set Conn = Nothing

Should realy do this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top