DB2 connection from excel macro

前端 未结 2 473
醉酒成梦
醉酒成梦 2021-01-07 14:50

I want to connect to DB2 from excel macro...This is my code, but it not working, Its giving error as \'Run-time Error\'...Can anyone help me...

Option Explic         


        
2条回答
  •  旧巷少年郎
    2021-01-07 15:11

    Start with changing

    DBCON = CreateObject("OLEDB.Connection")
    

    to

    Set DBCON = CreateObject("ADODB.Connection")
    

    If you still get an error, double-check your connection string.

提交回复
热议问题