I can register the dll fine using the 32 bit regsvr32, and when I build my app with x86 as the target CPU, the app does see the driver fine. However, if I attempt to open the connection, it blows up. Here's example code I threw into a winform for testing purposes:
namespace PolyOleTestWinform
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
OleDbConnection conn = new OleDbConnection("Provider=PatOleDB.PatOleDB.1;Password=password;User ID=username;Data Source=localhost:31001;");
conn.Open();
conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString() + "\n" + ex.StackTrace.ToString(), "Exception thrown");
}
}
}
}
The exception Message is "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." If I place the same executable on a 32 bit system with the oledb dll registered, it works fine. In the test app's case, it either throws a timeout error if there's no db running on that box, or does nothing at all since it successfully opens and closes the connection.
I'm attaching a mildly redacted screenshot of the exception window that gets generated, in case the stack trace is helpful to anybody with a deeper understanding of this than I have.
So, ultimately, am I just screwed, or is there a way to get this to actually work on x64? If it helps, I can provide a copy of the app and a copy of the oledb dll, but I can't provide a working database installation, sorry. Actually have a functional db isn't really necessary... when it blows up under x64, it blows up immediately, regardless of whether or not there's a db on the other end.
Attached image(s)
This post has been edited by satis: 30 June 2011 - 06:00 AM

New Topic/Question
Reply




MultiQuote




|