You can create a linked server with ODBC, but it's pretty hideously
slow. Queries do not use any of the indexes. So get ready for table-scan-ville. If you are searching for a single match, you can
use the TOP clause to cut down the query time, but that doesn't always
help.
Following is some sample code you can use in Query Analyzer to create
an ODBC linked server to Pervasive.
EXEC sp_addlinkedserver
@server = 'SAMPLE',
@provider = 'MSDASQL',
@srvproduct='Pervasive ODBC Client Interface',
@datasrc = 'MyDSN'
--@Server is the name of the new linked server
--@datasrc is the name of a local ODBC DSN
exec sp_tables_ex 'SAMPLE'
--The above will list all of the table available
select * from [SAMPLE].[MyDatabase]..[MyTable]
--First, the name of the linked server
--Second, the Pervasive database name, not the ODBC DSN
--Third, Nothing
--Fourth, the table name.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 16:49:06 |
Calls: | 6,646 |
Calls today: | 1 |
Files: | 12,190 |
Messages: | 5,327,111 |