Author Topic: MSSQL and VLisp  (Read 3637 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
MSSQL and VLisp
« on: June 15, 2010, 12:32:03 PM »
Hello everybody,

I'm working with a new vertical and they use a dbase in MSSQL, and I can't work it out with the Fleming group stuff.

I want to extend that vertical with useful things (as I dud with the other I work with for another client). Therefore I would need to read from and write to that dbase. This is what I have on information


Provider :  System.Data.SqlClient

Connectionstring : Server=(local)\SQLExpress;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TechlineSQL

Schema : dbo.


Does any body know how i can get access to that dbase?

Thanks in Advance

Bernd

Bernd

HasanCAD

  • Swamp Rat
  • Posts: 1326
Re: MSSQL and VLisp
« Reply #1 on: June 16, 2010, 05:45:02 AM »

kpblc

  • Bull Frog
  • Posts: 348
Re: MSSQL and VLisp
« Reply #2 on: June 18, 2010, 01:36:10 AM »
Sorry for my English.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: MSSQL and VLisp
« Reply #3 on: June 18, 2010, 02:09:28 AM »
Another way: http://www.fleming-group.com/

because Microsoft have not released a 64 bit version of the Jet Driver ADO.LSP will not work in an AutoCAD 64bit System.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

kpblc

  • Bull Frog
  • Posts: 348
Re: MSSQL and VLisp
« Reply #4 on: June 18, 2010, 02:21:47 AM »
Oops... Thank you for information.
Sorry for my English.

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7012
  • AKA Daniel
Re: MSSQL and VLisp
« Reply #5 on: June 18, 2010, 02:35:40 AM »
Actually, I am pretty sure you can connect to MSSQL server if you use its provider. something like

"Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername; Pwd=myPassword;"

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7012
  • AKA Daniel
Re: MSSQL and VLisp
« Reply #6 on: June 18, 2010, 04:22:15 AM »
this quick test works to connect

Code: [Select]
(defun c:doit ( / )
(vl-load-com)
(setq co (vlax-create-object "ADODB.Connection"))
(vlax-invoke-method co 'open 
"Provider=SQLNCLI10;Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Daniel\\Desktop\\meserver.mdf;Initial Catalog=meserver;Integrated Security=SSPI;"
"" "" nil)
)

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
Re: MSSQL and VLisp
« Reply #7 on: June 25, 2010, 06:04:39 AM »
Daniel,

sorry, i was trapped in drafting work and had no time to develop things. I checked your approach but get folling error

Quote
Foutmelding :Automation Error. Provider cannot be found. It may not be properly install

according to the info box in my vertical the provider should be

Quote
System.Data.SqlClient

to me this is all unknown territory, so i very much relay on setting it up once with the Swamps intel and then go from there, but i can't troubleshoot due to lack of sql knowledge.

Bernd
Bernd

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7012
  • AKA Daniel
Re: MSSQL and VLisp
« Reply #8 on: June 25, 2010, 07:06:29 AM »
what version of MSSQL are you running?

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
Re: MSSQL and VLisp
« Reply #9 on: June 25, 2010, 07:28:28 AM »
Daniel,
good Question, it came with the vertical... Mircosoft SQL Server 2005 is that the MySQL, because that is all i can find.

Bernd
Bernd

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7012
  • AKA Daniel
Re: MSSQL and VLisp
« Reply #10 on: June 25, 2010, 07:33:38 AM »
I'm just guessing here but try SQLNCLI instead of SQLNCLI10

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
Re: MSSQL and VLisp
« Reply #11 on: June 25, 2010, 07:52:28 AM »
Daniel,

you are the man, your guess was right. Connection works, no i have to find out how i can work with the data....

Thanks a lot!!

Bernd

Bernd

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 7012
  • AKA Daniel
Re: MSSQL and VLisp
« Reply #12 on: June 25, 2010, 08:00:45 AM »
If you have the connection string, just get in there and try modifying what's in Mr. Fleming's code  :-)

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
Re: MSSQL and VLisp
« Reply #13 on: June 25, 2010, 08:20:48 AM »
right,

that is what i did before in Access as well, and he, it works great! It is not about knowledge alone these days, it is about to now where to find it.......

Bernd

Amsterdammed

  • Swamp Rat
  • Posts: 507
  • Revit MEP 2016 Acad2013, OPEN DCL
Re: MSSQL and VLisp
« Reply #14 on: July 09, 2010, 03:31:03 AM »
Daniel,
a new problem came up. This all works fine, now i see that the vertical uses the same dbase, and i can't not connect to it because it is already open.

Can i disconnect the connecting running at the time and reconnect myself?



Thanks,

bernd
Bernd