在ODBC API 中连接SQL SERVER 数据库.如何判断某个表的某个字段是不是外键??如果是的话如何获得该外键关联的从表的表名和字段名???
请各位高手帮忙!!一定加分!!

解决方案 »

  1.   

    ODBC API 里面有个SQLForeignKeys()函数怎么用 啊.用这个函数可以实现上面的功能吗?
      

  2.   

    应该是可以的。。
    SQLForeignKeys can return: 
    A list of foreign keys in the specified table (columns in the specified table that refer to primary keys in other tables). 
    A list of foreign keys in other tables that refer to the primary key in the specified table. 
    上面是MSDN上的原话,你可以查一下MSDN嘛。。有示例程序的:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlforeignkeys.asp