Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hey,

when i open up a connection, i need to provide a string

 

[size=2][color=#0000ff]Dim[/color][/size][size=2] StrConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\" & Filename & ".dtq" 'i created a 'field, and it saved as a .dtq

[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] Conn [/size][size=2][color=#0000ff]As[/color][/size][size=2] OleDbConnection

[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] Cmd [/size][size=2][color=#0000ff]As[/color][/size][size=2] OleDbCommand

[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] DataReader [/size][size=2][color=#0000ff]As[/color][/size][size=2] OleDbDataReader

Conn = [/size][size=2][color=#0000ff]New[/color][/size][size=2] OleDbConnection(StrConnection) ' right here is where my error is[/size]

 

 

but im not too sure weather the provider is

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="

 

what would it be in MSDE's case? ( i got this source from my book, which i think used Acess to create their database (*.mdb files)

 

anyone know what im supposed to do?

 

thanks,

pent

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted (edited)

oh

but where would i specify what file im reading?

 

edit:

i tried this:

 

[size=2][color=#0000ff]Dim[/color][/size][size=2] conn [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlConnection
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] Cmd [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlCommand
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] DataReader [/size][size=2][color=#0000ff]As[/color][/size][size=2] SqlDataReader
conn = [/size][size=2][color=#0000ff]New[/color][/size][size=2] SqlConnection()
conn.ConnectionString = Application.StartupPath & "\Size.dtq"
conn.Open()
'just to test weather it works, i tried to messagebox the first cell i did:
[size=2]MessageBox.Show(DataReader.GetInt32(0))[/size]

 

 

unfortunately, the error is in

conn.ConnectionString = Application.StartupPath & "\Size.dtq"

which exists, but it says:

An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: Expected '=' delimiter while parsing connection value pair.

Then i changed the line to:

conn.ConnectionString =

conn.ConnectionString() = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\Size.dtq"

 

The error here is:

An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll

Additional information: Unknown connection option in connection string: provider.

taking out the "Provider=" still causes an erorr.

 

Finally i tried changing it to

conn.ConnectionString() = "Data Source=" & Application.StartupPath & "\Size.dtq"

:-) now the error shifts from THIS line to the line after it:

Conn.Open()

now saying,

 

 

An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

 

Additional information: System error.

does anyone know what im doing wrong?

 

-Pent

 

 

[/size]

Edited by ThePentiumGuy

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

wow, that's a great link :-D!

so basically, I cant store information in a premade DB, and when i distribute my application it'll (for example) MessageBox some of the contents of the DB?

 

im assuming this becuase you cant open premade DB files in SQL Server.

 

 

is this true?

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted

ohh :( that's the reason i wanted to do DB's in the first place,

 

what type of DB program would i need to create files readable by the OleDB thing?(anything besides Microsoft Access - anything free?)

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...