Connect to Microsoft SQL Server using VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 32

  • @theresahanvunguyen1677
    @theresahanvunguyen1677 2 ปีที่แล้ว

    Thanks, really helpful! Amongst many videos, I found my answers here.

  • @bassfischer4273
    @bassfischer4273 ปีที่แล้ว

    Thank you! Interesting and informative content. Question.. You did not include any clean-up in your demo.. closing of connection, destroying objects, etc. Do you not consider that necessary?

    • @SimpleExcelVBA
      @SimpleExcelVBA  ปีที่แล้ว

      It would be nice, but it is not necessary. It automatically cleans up after code ends.

    • @bassfischer4273
      @bassfischer4273 ปีที่แล้ว

      @@SimpleExcelVBA Thank you.

    • @SimpleExcelVBA
      @SimpleExcelVBA  ปีที่แล้ว

      @@bassfischer4273 You're welcome :)

  • @johnharry1849
    @johnharry1849 ปีที่แล้ว

    hi. how to access database through network and to other PC's?
    what is the connection string?

    • @SimpleExcelVBA
      @SimpleExcelVBA  ปีที่แล้ว

      Hello
      Just ask the owner for the connection string or for the details which will allow You to connect to his database.

  • @turkaykoc8587
    @turkaykoc8587 ปีที่แล้ว

    Thank you very much for sharing valuable information.

  • @dislook4954
    @dislook4954 3 ปีที่แล้ว

    Very nice, and we wish for lessons on linking excel VBA to sql server in addition, can I ask you a programming question, if you allow me

    • @SimpleExcelVBA
      @SimpleExcelVBA  3 ปีที่แล้ว +1

      Sure, ask whatever You want to ask :)

  • @rabihelhabta4399
    @rabihelhabta4399 ปีที่แล้ว

    how can you get the table from sql with column name? and how you can reverse this process, i.e. a vba code that will update sql table from excel data? thank you

    • @SimpleExcelVBA
      @SimpleExcelVBA  ปีที่แล้ว

      To get the column name instead of * in SELECT query type its name. To update the sql table use SQL query UPDATE instead of SELECT

    • @rabihelhabta4399
      @rabihelhabta4399 ปีที่แล้ว

      @@SimpleExcelVBA Amazing!, thank you for your prompt answer 😃

  • @kamalsardana4211
    @kamalsardana4211 2 ปีที่แล้ว

    Hey man!! Can you create the same video and i want to write my query in Excel.
    Thanks in advance

    • @SimpleExcelVBA
      @SimpleExcelVBA  2 ปีที่แล้ว

      Hello! What query? :)

    • @kamalsardana4211
      @kamalsardana4211 2 ปีที่แล้ว

      In your video you have pasted your query within your code. I want to create an excel vba program such that the query will be written by a user within excel worksheet rather than in a vba code directly

    • @SimpleExcelVBA
      @SimpleExcelVBA  2 ปีที่แล้ว

      @@kamalsardana4211 So in the place where query is pasted directly, put the range of the cell where the user will write query by himself :)

  • @rushabkumat2148
    @rushabkumat2148 2 ปีที่แล้ว

    I am getting an error in the second last line. How can I manage it. When I write sql query select* the code is working properly but when I write select distinct. I am getting an error in rssql.open sqlQuery, connection, adopenstatic

    • @SimpleExcelVBA
      @SimpleExcelVBA  2 ปีที่แล้ว

      Do You use MS SQL --> TSQL? Have You tried to seek in Google? If both yes and still got the problem contact me directly and send the code, we will try figure something out :)

  • @shankhapedia
    @shankhapedia ปีที่แล้ว

    Can You reply a Code That can Retrieve Column Header from ADODB Recordset.
    This Code Works Perfectly.
    But, the Provider Name Change to 'MSOLEDBSQL'.
    ASSUME ME AS BEGINNER.
    THANK YOU FROM INDIA.

    • @SimpleExcelVBA
      @SimpleExcelVBA  ปีที่แล้ว

      Hi, did You mean how to get ONLY column header or how to get a whole column using ADODB? I'm sorry, I don't understand what is the question.

    • @shankhapedia
      @shankhapedia ปีที่แล้ว

      I Just Want to Include All the Column Headers (From SQL Server) to First row in Excel, Along With the data in next row(which I get from SQL Query as shown in this video).
      I Want to Retrieve Whole Table.

    • @SimpleExcelVBA
      @SimpleExcelVBA  ปีที่แล้ว

      @@shankhapedia Have You tried to include HDR=Yes in connection string like I showed in simpleexcelvba.com/how-to-sql-query-excel-data-in-vba/

    • @shankhapedia
      @shankhapedia ปีที่แล้ว

      @@SimpleExcelVBA No. I didn't use HDR.
      As soon as I try this, Let you know in Comment.
      Thank You 💗.

  • @Yaponets5
    @Yaponets5 2 ปีที่แล้ว

    Спасибо, ты лучший в мире!

  • @aakashkadam2053
    @aakashkadam2053 2 ปีที่แล้ว

    Thanks 👍

  • @harmeetsingh1991
    @harmeetsingh1991 3 ปีที่แล้ว

    Good content