使用文本驱动程序减少连接

时间:2022-03-28 20:14:14

I am trying to do ODBC import with DSN-Less connection(using text driver). Is there any way to tell SQLDriverConnect to set COLNAMEHEADER=yes/no? OR I need to use schema.ini to do it? Actually i don't want to create schema.ini manually, Can I use SQLConfigDataSource for dsn less connection? I haven't found any docs regarding this.

我正在尝试使用DSN-Less连接进行ODBC导入(使用文本驱动程序)。有没有办法告诉SQLDriverConnect设置COLNAMEHEADER =是/否?或者我需要使用schema.ini来做到这一点?实际上我不想手动创建schema.ini,我可以使用SQLConfigDataSource来减少连接吗?我没有找到任何关于此的文档。

Thanks in advance, Manoj

在此先感谢Manoj

1 个解决方案

#1


Create the schema.ini programatically before you open the text file via SQLDriverConnect. I don't see how SQLConfigDataSources can help you here, as it is specifically intended for manipulating DSNs and you don't have one.

在通过SQLDriverConnect打开文本文件之前以编程方式创建schema.ini。我没有看到SQLConfigDataSources如何在这里为您提供帮助,因为它专门用于操作DSN而您没有DSN。

#1


Create the schema.ini programatically before you open the text file via SQLDriverConnect. I don't see how SQLConfigDataSources can help you here, as it is specifically intended for manipulating DSNs and you don't have one.

在通过SQLDriverConnect打开文本文件之前以编程方式创建schema.ini。我没有看到SQLConfigDataSources如何在这里为您提供帮助,因为它专门用于操作DSN而您没有DSN。