msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to set constraint in Access database using Visual Basic

 
Post new topic   Reply to topic    msvisual.com Forum Index -> DirectX
Author Message
kiran



Joined: 04 Oct 2007
Posts: 9

PostPosted: Tue Jun 05, 2007 9:20 am    Post subject: how to set constraint in Access database using Visual Basic Reply with quote

Hi All,
My requirement is how to set constraint to Sub_Modules column
On Error GoTo addfielderror
If txtmodule.Text = "" Then
MsgBox "Please Insert Module Name", vbInformation, "Adding"
txtmodule.SetFocus
Else
d = FLUpper(txtmodule.Text)
que = "Insert into Modules" & "(Modules)" & " Values (" & "'" & d &
"'" & ")"
cn.Execute que
MsgBox "Record " & d & " Added to Modules.", vbInformation, "Adding"
If vbOK = 1 Then
txtmodule.Text = ""
txtmodule.SetFocus
End If
End If

Set db = OpenDatabase("D:\VSS_WKF\SCM-VB\check\DB\scmregister.mdb")
Set tdf = db.CreateTableDef(d)

With tdf
.Fields.Append .CreateField("Sub_Modules")
db.TableDefs.Append tdf
Exit Sub
End With
addfielderror:
If Err Then
MsgBox "Module " & FLUpper(d) & " Alrady Exists", vbInformation, "Adding"
If vbOK = 1 Then
txtmodule.Text = ""
txtmodule.SetFocus
Exit Sub
ElseIf Err.Number = 3010 Then
MsgBox "Table Already Exists", vbOKOnly, "Table"
Else
MsgBox "Table " & d & " created."
End If
End If
Note: - FLUpper is my function

Pls help to solve
TIA

Archived from group: microsoft>public>vb>directx
Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Visual Basic 6 with XP I want to Visual Basic 6. Can I do this using XP, The product still seems to be for sale but appears to be for NT and 2000 etc not XP.

Visual Basic 6.0 operations Hi, I am really amazed when I started to use Visual Studio and installed a service pack 6 in Visual Studio 6.0, In my office, I used to have my Visual Basic ok to use, my codes are functioning well, and then I also installed Visual Basic at home, wich wor

Using DirectX 9 w/ Visual Basic 6.0 Will I be able to use DirectX 9 features (like Animation Controller) in my Visual Basic 6.0 project?

question about ldap and visual basic 6 i would like to connect a ldap server which is not establish in microsoft platform by visual basic 6. What can i do that

Creating a standalone Visual Basic 6 Application Currently I have a Visual Basic 6 project saved that compiles with no errors and runs exactly how I want it to, except I need the files to be saved like a normal application. I dont want to open Visual Basic 6, load my project, and run from there everytim
Post new topic   Reply to topic    msvisual.com Forum Index -> DirectX All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group