How to Delete Database using Code Module

Best practices, code snippets for common functionality, examples, and guidelines.
haye7889
Posts: 7
Joined: Thu Sep 07, 2017 2:31 pm

How to Delete Database using Code Module

Post by haye7889 » Wed Nov 01, 2017 8:17 pm

Hello,

I'm wondering if there is a way to truncate a database using a code module.
The tutorial for code modules haven't been helpful and I'm not a developer, so I was wondering if this was possible.
I want to basically run a test case where I have my user log in, adds some data, truncate the database, log off, and close the application.
So any help is great.

thanks!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3936
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to Delete Database using Code Module

Post by odklizec » Thu Nov 02, 2017 9:06 am

Hi,

I'm afraid, there is not an out-of-the-box solution for this prepared in Ranorex. You will have to write such code. If you are not familiar with DB programming, I would suggest to use google to search for a piece of code, which would suit your purpose.

For example, these links may help...
https://msdn.microsoft.com/cs-cz/librar ... 2147217396
https://stackoverflow.com/a/5170462
https://stackoverflow.com/a/14070272
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration