When I first create a dsn from code in access, and after when I link a view, it cause ODBC/Sqlserver ask for a Primary Key.
I want to know if there is a way to select the key from code, to prevent the opening of a dialog (for automatisation issues).
Here is the code for creating the dsn :
str = "Description=SQL Server " & vbCr & _
"Network=DBMSSOCN" & vbCr & _
"Address=" & ip & "," & port " & vbCr & _
"Server=mydsn" & vbCr & _
"Database=" & sql_serv_base & vbCr & vbCr
DBEngine.RegisterDatabase "mydsn", "SQL Server", True, str
and this is for creating the link :
DoCmd.TransferDatabase acLink, "Base de données ODBC", _
"ODBC;DSN=mydsn;UID=" & login & ";PWD=" & pwd &
";LANGUAGE=français;" & "DATABASE=" & sql_serv_base, _
acTable, !alias_, !alias_, True
after this command it ask for a primary key
Sorry for my english I'm french
Thanks
I want to know if there is a way to select the key from code, to prevent the opening of a dialog (for automatisation issues).
Here is the code for creating the dsn :
str = "Description=SQL Server " & vbCr & _
"Network=DBMSSOCN" & vbCr & _
"Address=" & ip & "," & port " & vbCr & _
"Server=mydsn" & vbCr & _
"Database=" & sql_serv_base & vbCr & vbCr
DBEngine.RegisterDatabase "mydsn", "SQL Server", True, str
and this is for creating the link :
DoCmd.TransferDatabase acLink, "Base de données ODBC", _
"ODBC;DSN=mydsn;UID=" & login & ";PWD=" & pwd &
";LANGUAGE=français;" & "DATABASE=" & sql_serv_base, _
acTable, !alias_, !alias_, True
after this command it ask for a primary key
Sorry for my english I'm french
Thanks