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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Primary Key With VB 6.0 (sp3)

Status
Not open for further replies.

Ologhai

Programmer
Apr 11, 2000
42
0
0
CA
Hi all,<br>i'm able to create my Database, Table and Field<br>with vb 6.0 procedure.<br><br>but i dont know how to attribute primary key through this procedure.<br><br>i just wanna help to create primary key<br>in my &quot;employe&quot; table on &quot;emp_no&quot; field.<br><br>thx to help<br><br><A HREF="mailto:hugues_gauthier@hotmail.com">hugues_gauthier@hotmail.com</A><br>
 
ADO or DAO? <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
after you create your table, use a separate sql command to declare the primary key<br><br>eg:<br><br>strSQL = &quot;ALTER table Employe ADD Primary Key (Emp_No)&quot;<br><br><br>hope this helps<br><br><br><br>
 
i found how to...<br><br>wcon.open<br>wSQL = &quot;ALTER TABLE &quot; & wTable & &quot; ADD CONSTRAINT test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PRIMARY KEY (&quot; & wChamp & &quot;)&quot;<br>wCon.Execute wSQL<br>wCon.Close<br><br>thx all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top